SQL Server Error Message:
An expression of non-boolean type specified in a context where a condition is expected, near ‘%.*ls’.
What and Why "this Error":
This error occurs when you try to use a non-boolean expression in the context where a boolean expression is expected. For example: the following statement will raise the above error.
USE tempdb CREATE TABLE TEST ( COL1 INT ) GO SELECT COL1 FROM TEST WHERE 1 GO DROP TABLE TEST GO
Action Required to resolve this Error:
The solution to this error is it must evaluate to a boolean result. In the above example we try to run a query that tries to use the non-boolean expression 1 in the WHERE clause. This raises the error. The following statement will execute successfully.
USE tempdb CREATE TABLE TEST ( COL1 INT ) GO SELECT COL1 FROM TEST WHERE COL1=1 GO DROP TABLE TEST GO
If this page has HELPED you somehow then do
You can also join me here to get daily SQL Server Tutorial / NEWS