Add a unique constraint for that column:
alter table Foo add constraint UQ_Name unique (Name)
To add it through SQL Management Studio UI:
- Open SQL Server Management Studio.
- Expand the Tables folder of the database where you wish to create the constraint.
- Right-click the table where you wish to add the constraint and click Design.
- In Table Designer, click Indexes/Keys.
- Click Add.
- Choose Unique Key in the Type drop-down list.
No comments:
Post a Comment