Thursday, February 2, 2012

SQL Server Unique Constraints Vs. Unique Indexes

PROBLEM:
What is the difference between SQL Server unique constraints and unique indexes?

SOLUTION:
In summary, there's no practical difference between a unique constraint and a unique index other than the fact that the unique constraint is also listed as a constraint object in the database. Since a unique constraint can't be disabled, having the status of a constraint doesn't give the unique constraint any additional behavior beyond a unique index. However, there are several index creation options that aren't available to the ALTER TABLE command that creates a unique constraint

http://msdn.microsoft.com/en-us/library/aa224827(v=sql.80).aspx


If you find this solution useful, you are welcome to press one of the ads in this page.. Thanks!


No comments:

Post a Comment