How do I make a composite key with SQL Server Management Studio?

mrblah picture mrblah · Oct 9, 2009 · Viewed 172.9k times · Source

How do I make a composite key with SQL Server Management Studio?

I want two INT columns to form the identity (unique) for a table

Answer

Cory picture Cory · Oct 9, 2009

enter image description here

  1. Open the design table tab
  2. Highlight your two INT fields (Ctrl/Shift+click on the grey blocks in the very first column)
  3. Right click -> Set primary key