Why does EXCEPT not work? Incorrect Syntax near the Word Except

bizness picture bizness · Nov 2, 2010 · Viewed 11.9k times · Source
SELECT SKU
FROM PartProductSupplemental
EXCEPT
SELECT SKU
FROM Inventory

Why do I get this error:

Incorrect Syntax near the Word Except

I check on line and syntax is syntactically correct:

SELECT ProductID 
FROM Production.WorkOrder
EXCEPT
SELECT ProductID 
FROM Production.Product

Answer

Vidar Nordnes picture Vidar Nordnes · Nov 2, 2010

Your database compatibility mode is probably set to 2000 (80) or earlier.

In Management Studio:

  1. Right click on the database name under the "Databases" heading in the Object Explorer
  2. In the Properties window that pops up, select "Options" - Compatibility Level is third from the top, on the right.