MSSQLMSSQL 102

MSSQL 102: Incorrect Syntax Near

SQL Server error 102 is the generic syntax error. The error message includes the token near which parsing failed, pointing to the location of the syntax problem.

Example Query

SELECT TOP(10 * FROM orders;
-- Missing closing parenthesis

Common Causes

  1. 1Missing or extra parenthesis, comma, or quote
  2. 2Using MySQL or PostgreSQL syntax not supported by T-SQL (e.g. LIMIT instead of TOP)
  3. 3Reserved word used as an identifier without square-bracket quoting

How to Fix It

Check the token reported in the error message. Use [square brackets] to quote reserved words as identifiers. Replace MySQL LIMIT with SQL Server TOP(n): SELECT TOP(10) * FROM orders.

Need a reliable database?

Try Supabase — free PostgreSQL with a generous free tier. No credit card required.

Get started free →

Got a query causing this error?

Paste it into SQLbuddy and get an instant plain-English explanation with optimization tips.

Analyze My Query →