2
Reply

Explain the difference between UNIQUE constraint and PRIMARY KEY constraint in SQL Server?

Arjun Kumar

Arjun Kumar

12y
1.4k
0
Reply

    A table can have only one primary key, but many unique columns. And Primary key is not allow any null value while Unique key one null values allow.

    Unique constraint makes the column to hold only unique values. It may include null value too. Any column which is unique cannot be used for references with other table unless it is a primary key. Primary key is clustered index and it does not support null values. A table can have only one primary key, but many unique columns.