What are difference between Primary key Constraint and Unique key Constraint in SQL Server?

Unique Key Constraint:

Unique key will create column data uniqueness in the table.

Unique Key allows null values in the column.
Unique key will create non-clustered index by default.
You can add any number of unique constraints in to a table.

Primary Key Constraint: 
Primary key will create column data uniqueness in the table.
Primary key is not allowed Null values into the column values.
Once we set the primary column then by default Primary key will create clustered index.
We can create only one primary key into table.

Leave a Reply

Your email address will not be published. Required fields are marked *

6 + 7 =


All Rights Reserved 2019 | DesignzRush (OPC) Pvt. Ltd.
Inline
Inline