Difference between Primary key Constraint and Unique key Constraint in SQL Server.

 Posted by Anitha on 11/6/2008 | Category: Sql Server Interview questions | Views: 14595

Unique Key Constraint:
The column values should retain uniqueness.
It allows null values in the column.
It will create non-clustered index by default.
Any number of unique constraints can be added to a table.

Primary Key Constraint:
Primary key will create column data uniqueness in the table.
It Wont allow Null values.
By default Primary key will create clustered index.
Only one Primary key can be created for a table.
Multiple columns can be consolidated to form a single primary key.

Source: [b]http://interviews.dotnetthread.com/ [/b]

Source: http://interviews.dotnetthread.com/ | Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Naraayanan on: 7/20/2012 | Points: 10
Nice information.Can you tell me How to identify Unique Key Constraint?

Login to post response

More Interview Questions by Anitha