Quantcast
Channel: SQL Errors – SQLSERVERLEARNER
Browsing all 74 articles
Browse latest View live

Cannot use the %ls granularity hint on the table “%.*ls” because locking at...

This error occurs when the lock cannot be applied on a specific table at a specified granularity. It occurs for two granularity levels: ROW PAGE For more information on ROW granularity locking error...

View Article


The conversion of a varchar data type to a datetime data type resulted in an...

When you try to convert varchar datatype to datetime you would get this error when the value in varchar datatype does not represent the correct range of date. Example Queries: SELECT CAST( '2012-04-31'...

View Article


FIX – Cannot Restore SQL Server 2000 Backup on SQL Server 2012

Unable to Restore SQL Server 2000 Backup on SQL Server 2012? If you are trying to restore SQL Server 2000 backup on SQL Server 2008 you would be facing error like: Msg 3169, Level 16, State 1, Line 1...

View Article

Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1

When you try to execute sp_executesql you get the below error: Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1 Procedure expects parameter ‘@statement’ of type ‘ntext/nchar/nvarchar’. Fix:...

View Article

Msg 206, Level 16, State 2, Line 6 Operand type clash: int is incompatible...

Error: Msg 206, Level 16, State 2, Line 6 Operand type clash: int is incompatible with xml This error comes up when you try to set XML variable with an int value. Sample Code: DECLARE @Var1 XML DECLARE...

View Article


Duplicate column names are not allowed in result sets obtained through...

Error: Msg 492, Level 16, State 1, Line 3 Duplicate column names are not allowed in result sets obtained through OPENQUERY and OPENROWSET. The column name “A” is a duplicate. Possible Reason: Column...

View Article

Msg 8180, Level 16, State 1, Line 1 Statement(s) could not be prepared.

Error: OLE DB provider “SQLNCLI10″ for linked server “(null)” returned message “Deferred prepare could not be completed.”. Msg 8180, Level 16, State 1, Line 1 Statement(s) could not be prepared. Msg...

View Article

Msg 207, Level 16, State 1, Line 1 Invalid column name ‘names’.

Error Message: Msg 207, Level 16, State 1, Line 1 Invalid column name ‘names’. Fix/Resolution: 1) Use correct alias names in your tsql code 2) Check if the column name exists in the table (or) Table...

View Article


Transaction (Process ID ) was deadlocked on resources with another process...

Error Message: Msg 1205, Level 13, State 56, Line 1 Transaction (Process ID 56) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction....

View Article


The data types varchar(max) and xml are incompatible in the add operator

Error Message: Msg 402, Level 16, State 1, Line 5 The data types varchar(max) and xml are incompatible in the add operator. This message occurs when you try to add varchar and xml data types. Fix: If...

View Article

Conversion failed when converting the varchar value xx to data type int.

Error Message: Msg 245, Level 16, State 1, Line 5 Conversion failed when converting the varchar value ’20.0′ to data type int. This error occurs when you try to convert varchar datatype to datatype int...

View Article

The column prefix ‘A’ does not match with a table name or alias name used in...

Error Message: Msg 107, Level 15, State 1, Line 1 The column prefix ‘A’ does not match with a table name or alias name used in the query. This error occurs when the correct table name/alias is not used...

View Article

The select list for the INSERT statement contains fewer items than the insert...

Error Message: Msg 120, Level 15, State 1, Line 2 The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT...

View Article


The select list for the INSERT statement contains more items than the insert...

Error Message: Msg 121, Level 15, State 1, Line 3 The select list for the INSERT statement contains more items than the insert list. The number of SELECT values must match the number of INSERT columns....

View Article

A TOP N value may not be negative

Error Message: Msg 127, Level 15, State 1, Line 1 A TOP N value may not be negative. This error occurs when you try to specify negative value for the TOP Clause in the select statement. Simple Example:...

View Article


String or binary data would be truncated

Error Message: Msg 8152, Level 16, State 14, Line 4 String or binary data would be truncated. The statement has been terminated. Why this error? This error occurs whan the size of data that is inserted...

View Article

Cannot roll back xxxxxxxx. No transaction or savepoint of that name was found.

Error Message: Msg 6401, Level 16, State 1, Line 1 Cannot roll back t2. No transaction or savepoint of that name was found. This error orccurs when the Transaction or save point name that is specified...

View Article


Cannot issue SAVE TRANSACTION when there is no active transaction.

Error Message: Msg 628, Level 16, State 0, Line 1 Cannot issue SAVE TRANSACTION when there is no active transaction. Why This Error? - This error occurs when SAVE TRANSACTION/TRAN command is issued...

View Article

Incorrect syntax near the keyword into

Error Message: Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword ‘INTO’. This error occurs when the syntax of the select into statement is not correct. Example: SELECT * FROM Product...

View Article

Msg 4621 Level 16 State 10 Line 1 Permissions at the server scope can only be...

Error Message: Msg 4621, Level 16, State 10, Line 1 Permissions at the server scope can only be granted when the current database is master This message occurs when the Server scope permissions are...

View Article
Browsing all 74 articles
Browse latest View live