I need 1 column in the table to hold unique non-null values or NULL
. TSQL UNIQUE
constraint treats 2 NULL
s as equal, so I cannot
Normalise it. Move the column to a new table together with your current table's primary key. Make the column unique and not null in the new table. Nullable unique constraints make no logical sense and are of little or no practical use.
SQL 2008 allows you to define a filtered index - essentially an index with a WHERE
clause - see Phil Haselden's asnwer to this question for MSDN links and an example.
4 ways: