Can you use UNIQUE KEY as a replacement for Primary Key ?

  • Both Keys are different. For Identifying each and every record in a table we use primary key.
  • To apply additional uniqueness for other columns on the table we use Unique Key.
  • Primary Keys are important for a table.
  • Internal users use Primary Key whereas external users use unique key as it contains some meaningful information.
  • When uniqueness is needed for multiple columns for a table, we use unique key for all columns and primary keys cannot be used in this case.
  • Primary key uses clustered index by default and unique key uses Non-clustered index.

Leave a Reply

Your email address will not be published.

You May Also Like