Skip to main content
2 of 2
added 303 characters in body
Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619

The syntax for inline index declaration was added in SQL Server 2014, though that is was absolutely unclear in the official CREATE TABLE documentation. After speaking to the documentation owners, that topic now accurately reflects that inline index syntax is only valid starting with SQL Server 2014 (and some variations in 2016):

enter image description here

The other instances, where this syntax is working for you, must be on SQL Server 2014 or newer.

On 2012, regardless of compatibility level, you'll need to create the index separately.

Aaron Bertrand
  • 181.5k
  • 28
  • 402
  • 619