156: Incorrect syntax near the keyword
SQL ServerWhat does it mean?
There is a syntax error near a keyword. SQL Server could not parse the statement because a reserved word is used in an unexpected position.
Why does it happen?
Using a reserved word (e.g. ORDER, USER, TABLE) as a column/object name without brackets, a missing comma/parenthesis, clauses in the wrong order, or a misplaced clause (WHERE, GROUP BY).
How to fix it
Inspect the area around the keyword the error points to. If you use reserved words as object names, wrap them in square brackets (e.g. [User]). Fix missing commas, parentheses, and clause order. Test the syntax by breaking the query into parts.
More from this engine
- 8115Arithmetic overflow error converting expression to data type
- 512Subquery returned more than 1 value
- 207Invalid column name
- 2812Could not find stored procedure
- 8623The query processor ran out of internal resources and could not produce a query plan
- 4104The multi-part identifier could not be bound
- 2714There is already an object named in the database