Reputation: 1417
How to set unique key constraint
in SQL Server 2005? Not through script or query.
Upvotes: 1
Views: 2529
Reputation: 68456
To add a unique key without scripting, follow these steps:
Once you've done this, click close and save your table.
If you'd rather have a primary key, such as an auto incrementing integer
If you literally just want to set an existing column as a primary key:
Upvotes: 3
Reputation: 452988
In management studio table designer right click the table and choose "Indexes/Keys" from the popup menu.
Select the column(s) that comprise the key and choose "Unique Key" for the "Type" option.
Upvotes: 4