SQL Server Errors or Failures Error: 141 to Error: 162


Below are some of the SQL Server Errors from Error: 141 to Error: 162.

Error: 141, Severity: 15,
A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.

Error: 142, Severity: 15,
Incorrect syntax for definition of the ‘%ls’ constraint.

Error: 144, Severity: 15,
Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP BY clause.

Error: 145, Severity: 15,
ORDER BY items must appear in the select list if SELECT DISTINCT is specified.

Error: 146, Severity: 15,
Could not allocate ancillary table for a subquery. Maximum number of tables in a query (%d) exceeded.

Error: 147, Severity: 15,
An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.

Error: 148, Severity: 15,
Incorrect time syntax in time string ‘%.*ls’ used with WAITFOR.

Error: 149, Severity: 15,
Time value ‘%.*ls’ used with WAITFOR is not a valid value. Check date/time syntax.

Error: 151, Severity: 15,
‘%.*ls’ is an invalid money value.

Error: 152, Severity: 15,
The same large data placement option “%.*ls” has been specified twice.

Error: 153, Severity: 15,
Invalid usage of the option %.*ls in the %ls statement.

Error: 154, Severity: 15,
%S_MSG is not allowed in %S_MSG.

Error: 155, Severity: 15,
‘%.*ls’ is not a recognized %ls option.

Error: 156, Severity: 15,
Incorrect syntax near the keyword ‘%.*ls’.

Error: 157, Severity: 15,
An aggregate may not appear in the set list of an UPDATE statement.

Error: 158, Severity: 15,
An aggregate may not appear in the OUTPUT clause.

Error: 159, Severity: 15,
Must specify the table name and index name for the DROP INDEX statement.

Error: 160, Severity: 15,
Rule does not contain a variable.

Error: 161, Severity: 15,
Rule contains more than one variable.

Error: 162, Severity: 15,
Invalid expression in a TOP or OFFSET clause.

This is applicable on below versions of SQL Server

SQL Server 2005
SQL Server 2008 R2
SQL Server 2012
SQL Server 2014

Hope this was helpful.

SQLServerF1 Team
In-Depth Blogs on SQL Server, Information about SQL Server Conferences and Events, SQL Server Frequently asked questions, SQL Server Trainings.


Leave a Reply

Your email address will not be published. Required fields are marked *