Creare un indice Unique su una colonna Null in T-SQL
Script T-SQL per creare un indice unique in SQL Server:
SQL
CREATE UNIQUE NONCLUSTERED INDEX [IX_TbName_MyColumn] ON [dbo].[TbName]
(
[MyColumn] ASC
)
WHERE ([MyColumn] IS NOT NULL)