My Technical Notes

Tuesday, 16 April 2013

Adding a Column Uniqueness constraint in SQL Server

Use the following code:


ALTER TABLE <tablename> 
ADD CONSTRAINT <constraintname> UNIQUE NONCLUSTERED
(
    <columnname>
)

No comments: