What's the difference between a primary key and a unique
key?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ramneet
There is one more diff b/w primary key and unique key that
there is only one primary key in a table but there are more
then one unique keys in a table.
Is This Answer Correct ? | 11 Yes | 2 No |
Answer / gowthami radhakrishnana
1)primary key uses clustered index
unique key uses non-clustered index
2)primary key doesn't allow null values
but unique allows one null value
3)there is only one primary key but more than one unique
keys
Is This Answer Correct ? | 5 Yes | 1 No |
Answer / ramneet
Primary can be used in foregin key but unique key does not
used.
Is This Answer Correct ? | 4 Yes | 2 No |
Does the order of columns in update statements matter?
Which are new data types introduced in sql server 2008?
What is the Disadvantage of indexed sequential file.
What is a trace frag?
How do you identify a foreign key?
Can you tell me some of the common replication dmv's and their use? : sql server replication
What is Dedicated Administrator Connection in sql server 2005?
how can we know that how many users are connected in perticuler server??????
Explain try...catch with sql server?
What is the difference between dbcc indexdefrag and dbcc reindex?
Benefits of Stored Procedures?
What is the exact numeric data type in sql?