Categories
Sql Server

Difference Between Primary Key and Unique Key

Difference Between Primary Key and Unique Key

In this post we will see the Difference Between Primary Key and Unique Key.Primary key and Unique key which seems to be identical, but they are different in features and behavior.We already discussed on our earlier post about Primary key & Unique Key.

Difference between Primary key and Unique key:

Primary Key Unique Key
 It does not allow any null value. Unique key can accept only a single null value.
 Primary key is clustered index. Unique key is a unique Non-Clustered index.
 We can have only one Primary key in a table. We can have more than one unique key in a table.