Sql Server

In which scenario I can use the unique key and primary key in SQL Server .
I mean in real life database how can I judge where I have to use the unique key and primary key.

Questions by varun.dtsfi

Showing Answers 1 - 2 of 2 Answers


  • May 29th, 2012

A Unique ID and Primary Key Constrain perform the ability to allow unique data in the column but only the Unique constrain allows NULL values in the field along with the unique data. Primary Key constrain fields allow Unique and Not NULL values.

  Was this answer useful?  Yes

sunil neha juhi singh

  • Jun 28th, 2012

primary key=not allow null values,create cluster index by default.
unique key=allow only one null values and by default it create non cluster index

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions