Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Difference b/n Primary Key and Unique Key

1) Primary Key can't not be Null where as Unique may be Null some times if declared but by default we can have only one Null value in Unique Column.
2) Maximum one Primary Key can be declared in a table where we can declare many Unique keys.
3) Primary key can be associated with another table's Foreign Key whereas it is impossible for Unique Key field.
4) With Auto Increment field we can assign it as Primary Key but are unable to do that with Unique Key.


This post first appeared on ASP.NET CODES, please read the originial post: here

Share the post

Difference b/n Primary Key and Unique Key

×

Subscribe to Asp.net Codes

Get updates delivered right to your inbox!

Thank you for your subscription

×