Set column as unique in SQL Server from the GUI:
Make sure your column does not violate the unique constraint before you begin.
- Open SQL Server Management Studio.
- Right click your Table, click "Design".
- Right click the column you want to edit, a popup menu appears, click Indexes/Keys.
- Click the "Add" Button.
- Expand the "General" tab.
- Make sure you have the column you want to make unique selected in the "columns" box.
- Change the "Type" box to "Unique Key".
- Click "Close".
- You see a little asterisk in the file window, this means changes are not yet saved.
- Click Save or hit Ctrl+s. It should save, and your column should be unique.
Comments
Post a Comment