1

I want to create composite key in sql server. What is the maximum limit of columns, which i can combine to create composite key in sql server 2008 ?

Naresh Parmar
  • 462
  • 3
  • 16
  • http://stackoverflow.com/questions/1545571/how-do-i-make-a-composite-key-with-sql-server-management-studio – Habib May 16 '13 at 06:51
  • Thanks for your quick reply. But, i want to know the max. limit of column , which i can use to create composite key. – Naresh Parmar May 16 '13 at 06:53

1 Answers1

2

SQL Server Maximum Capacity Specifications:

Columns per primary key 16

(And similarly for indexes, foreign keys, etc). So, 16.

But, as with so many questions, if you have to ask about the limit, you're probably doing something wrong.

Can you identify anything in everyday life that requires 16 distinct pieces of data to uniquely identify it?


Alternatively, your question might be construed to be about the width of the columns that can go into the key. That's also answered on the same page:

Bytes per primary key 900

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448