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.
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.
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.