Difference between Primary key and Unique key in SQL Server

Primary key and unique key are useful for maintaining uniqueness of the column.

Primary Key:
1. create clustered index on the column.
2. No null value allows
3. We can create only one primary key.
4. This is useful for referential integrity.

Unique Key:
1. Create non-clustered index on the column.
2. only one null value will allow.
3. we can create more than one unique key on table.
4. We can't create foreign key with unique key as reference.

Share this post :

Post a Comment

Please give your valuable feedback on this post. You can submit any ASP.NET article here. We will post that article in this website by your name.

 
Support : Ranga Rajesh Kumar
Copyright © 2012. ASP.NET Examples - All Rights Reserved
Site Designed by Ranga Rajesh Kumar