Difference Between Unique Key and Primary Key in SQL Server

Unique key and primary key both are represent unique value in table.

Difference :

  1. Primary key don't hold any null value but Unique key can hold null value.
  2. Unique key can hold only single null value.
  3. A table in sql database can have only single primary key but can have multiple unique key.
  4. Primary key have clustered index by default but unique key have non-clustered index by default.
Ebook Download
View all
Learn
View all