Unique Constraint in SQL
Can anyone tell me why does a column having Unique Constraints can not contain two null values?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mamta MRank #268 · 9.4K reputationPosted Oct 9, 2011, 8:22 PM EDT
Pravin Patil60 reputationPosted Oct 9, 2011, 10:23 PM EDT
With this it is quite clear that since null is also a value, there can not be two students who have phone as value with NULL.
Hope this helps.
All the best.
Pravin Patil60 reputationPosted Oct 9, 2011, 10:23 PM EDT
Prabhu RajaRank #861 · 2.6K reputationPosted Oct 9, 2011, 11:03 PM EDT
Unique Key will Generate Non-Clustured Index.
UNIQUE Key can have only one NULL in Sql server (For Oracle : Unique key may have more then one null values because null is equal to another null)