Pages

22 Apr 2012

MS SQL Primary key vs Unique Key

In MS SQL environment the main differences between a Primary key and Unique key are

  • primary key does not allow nulls however unique key does allow.
  • primary key does clustered indexing, whereas unique key does non clustered indexing.
  • both can be used for constraints.
  • multiple unique keys can be defined for a table, but only a single primary key in a table.

No comments:

Post a Comment