SQL Server Errors

‘%1!’ must be the first statement in a query batch.

Error Message:Msg 111, Level 15, State 1, Line 7‘%1!’ must be the first statement in a query batch. Severity level:15. Description:This error message appears, when you try to execute statements in a batch that need to be separated in different batches or that need to executed in a different order in the same batch. Consequences:The […]

Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

Error Message:Msg 116, Level 16, State 1, Line 2Only one expression can be specified in the select list when the subquery is not introduced with EXISTS. Severity level:16. Description:This error message appears, when a subquery that is not introduced with EXISTS contains more that one expression in the SELECT list. Consequences:The T-SQL statement can be […]

ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator.

Error Message:Msg 104, Level 16, State 1, Line 1ORDER BY items must appear in the select list if the statement contains a UNION, INTERSECT or EXCEPT operator. Severity level:16. Description:This error message appears when you try to sort a resultset by an element that is not contained in the SELECT list and the statement contains […]

Must specify the table and the index name for DROP INDEX statement.

Error Message:Msg 159, Level 15, State 1, Line 1Must specify the table and the index name for DROP INDEX statement. Severity level:15. Description:This error message appears, when you try to issue a DROP INDEX statement without specifying a table- or indexname. Consequences:The SQL statement cannot be parsed and further execution is stopped. Resolution:Error of the […]

Incorrect time syntax in time string ‘%1!’ used with WAITFOR.

Error Message:Msg 148, Level 15, State 1, Line 2Incorrect time syntax in time string ‘%1!’ used with WAITFOR. Severity level:15. Description:This error message appears when an invalid time syntax is encountered in the WAITFOR statement. Consequences:The SQL statement cannot be parsed and further execution is stopped. Resolution:Error of the Severity Level 15 are generated by […]

DEFAULT or NULL are not allowed as explicit identity values.

Error Message:Msg 339, Level 16, State 1, Line 2DEFAULT or NULL are not allowed as explicit identity values. Severity level:16. Description:This error message appears, when one tries to explicitely INSERT a NULL marker into a column with the IDENTITY property. The same error is raised, when one tries to enter a value into such an […]

A constant expression was encountered in the ORDER BY list, position %i.

Error Message:Msg 408, Level 16, State 1, Line 1A constant expression was encountered in the ORDER BY list, position %i. Severity level:16. Description:This error message appears, when you try to use a constant expression in the ORDER BY clause. Consequences:The T-SQL statement can be parsed, but causes the error at runtime. Resolution:Error of the Severity […]

Invalid argument for SET ROWCOUNT. Must be a non-null non-negative integer.

Error Message:Msg 507, Level 16, State 2, Line 3Invalid argument for SET ROWCOUNT. Must be a non-null non-negative integer. Severity level:16. Description:This error message appears, when you try to call SET ROWCOUNT with an invalid argument. Consequences:The T-SQL statement can be parsed, but causes the error at runtime. Resolution:Error of the Severity Level 16 are […]

Invalid length parameter passed to the %ls function.

Error Message:Msg 536, Level 16, State 1, Line 3Invalid length parameter passed to the %ls function. Severity level:16. Description:This error message appears, when you call a string function with an invalid length parameter. Consequences:The T-SQL statement can be parsed, but causes the error at runtime. Resolution:Error of the Severity Level 16 are generated by the […]

Could not find any index named ‘%1!’ for table ‘%2!’.

Error Message:Msg 7999, Level 16, State 10, Line 1Could not find any index named ‘%1!’ for table ‘%2!’. Severity level:16. Description:This error message is raised, when SQL Server cannot find the specified index on that table. Consequences:The T-SQL statement can be parsed, but causes the error at runtime. Resolution:Error of the Severity level 16 are […]