2
Reply

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

Arjun Kumar

Arjun Kumar

Jul 06, 2012
1.4k
0

    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.

    Akkiraju Ivaturi
    August 05, 2012
    0