Unique Constraint: Enforce uniqueness on a column which is not the column used to primarily identify each row. : Unique « Constraints « SQL Server / T-SQL Tutorial






5> CREATE TABLE Employee (
6>    EmployeeID Int IDENTITY(1,1) NOT NULL
7>   , LastName nVarChar(50) NOT NULL
8>   , FirstName nVarChar(50) NOT NULL
9>   , SSN Char(9) NOT NULL)
10> GO
1>
2>
3> drop table Employee;
4> GO
1>








7.10.Unique
7.10.1.Adding a UNIQUE Constraint to an Existing Table
7.10.2.Unique constraints will also allow one NULL, whereas primary keys will not.
7.10.3.Unique Constraint: Enforce uniqueness on a column which is not the column used to primarily identify each row.
7.10.4.Unique constraints can be created when initially creating the table or added after.
7.10.5.Unique constraint
7.10.6.Creating a UNIQUE Constraints when creating a table
7.10.7.Creating UNIQUE Constraints on Existing Tables