EXPLAIN EXTENDED

How to create fast database queries

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

Snowflake_300um_LTSEM[1]

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:

Read the rest of this entry on tech.pro ยป

Written by Quassnoi

July 19th, 2013 at 11:00 pm

Posted in SQL Server