Archive for July 19th, 2013
10 things in SQL Server (which don’t work as expected)
Comments enabled. I *really* need your comment
10. Unique NULL
When declaring UNIQUE constraints on columns, SQL Server treats all NULL values as unique. This means you can't have more than one NULL value in a unique column.
This behavior violates the standard and is specific to SQL Server.
To work around this, implement the constraint by declaring a UNIQUE index which would exclude NULL values: