What's the difference between a primary key and a unique
key?

Answer Posted / swapna

Both primary key and unique enforce uniqueness of the
column on which they are defined. But by default primary
key creates a clustered index on the column, where are
unique creates a nonclustered index by default. Another
major difference is that, primary key doesn't allow NULLs,
but unique key allows one NULL only.

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are database states in ms sql server?

644


How can we get count of the number of records in a table?

535


Explain syntax for disabling triggers?

510


What do you understand by sql server agent?

521


Why SQL Agent is used?

593






Explain trigger and its types?

605


How to use order by with union operators in ms sql server?

568


What are some examples of schemas?

526


Do you know the policy based administration feature of sql server 2008?

567


What are transactions and its controls?

607


How many null values we can have in a unique key field in sql server?

545


Explain transaction server distributed transaction?

495


Explain the truncate command?

516


What is side by side migration in sql server?

526


Call by value and call by reference in procedure and function, with NOCOPY.

827