Pages

Mar 25, 2018

SQL Server (Starting with 2016): How Many Foreign Key Can You create on a Table?

A table can reference a maximum of 253 other tables and columns as foreign keys (outgoing references). 

SQL Server 2016 increases the limit for the number of other table and columns that can reference columns in a single table (incoming references), from 253 to 10,000. (Requires at least 130 compatibility level.) 

Following are the limitations:

  • Greater than 253 foreign key references are supported for DELETE and UPDATE DML operations. MERGE operations are not supported.
  • A table with a foreign key reference to itself is still limited to 253 foreign key references.
  • Greater than 253 foreign key references are not currently available for columnstore indexes, memory-optimized tables, or Stretch Database.
References: Microsoft Books online


No comments: