Tuesday, July 14, 2009

When we can declare a column as Unique and Not Null both at the same time. What is the use Primary Key then?

Unique Key creates Non-Cluster index in default, But in Primary Key creates Cluster index in default.

1)unique key can be null but Primary key cant be null.

2)primary key can be referenced to other table as Foreign Key.

3)we can have multiple unique key in a table but PK is one and only one.

Primary key in itself is unique key.

Primary key which allows only unique+not null values,where has unique allow unique and null values because a null value is not equal to a null value

No comments: