T-SQL 101: 134 What is a Unique Constraint in SQL Server?
In the previous post, I talked about check constraints. Another type of constraint in SQL Server is a unique constraint.
What I want to specify is that a value in a column is unique i.e., no other row has that same value in that column. While a check of the values can be manually requested, the constraint is normally checked when SQL Server is inserting or updating the row.
It is also possible to specify a unique constraint at the table level, rather than at the column level.
2025-03-24