August 29, 2009 at 2:20 am
Hi,I have a question that I can't find the answer anywhere...I know that in sql2005 the unique constraint can keep just one null record,but I don't know that why it can keep one null and the usage of this null record in sql2005??...if someone know the answer please tell it....thanks in advance
August 29, 2009 at 7:12 am
There's no real use. It's just that within unique indexes is the only place where nulls are considered the same. Unique indexes and unique constraints only allow a single null. Irritating, but that's how it it.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 30, 2009 at 8:58 pm
GilaMonster (8/29/2009)
It's just that within unique indexes is the only place where nulls are considered the same.
NULLs are also considered 'the same' by GROUP BY, DISTINCT, UNION, EXCEPT, INTERSECT...and probably others 😛
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply