Thursday, April 5, 2012

Difference between a primary key and a unique key?

Primary Key doesnt allow the Null Values. where as in
Unique accept the Null values.
One table may have more than one Unique Key Constraint.
But it sholud have only one Primary Key Constraint column.
But by default primary key creates a clustered index on the column, where are unique creates a non-clustered index by default.
Primary key Supports Auto Increment value
but
Unique doesn't support auto Increment value

No comments: