Advertisement
bluebunny72

Filtered Unique Index

May 27th, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.24 KB | None | 0 0
  1. IF NOT EXISTS(SELECT TOP 1 1 FROM sys.indexes WHERE name = 'IX_ILC_iso_country_code')
  2.   BEGIN
  3.     CREATE UNIQUE NONCLUSTERED INDEX IX_ILC_iso_country_code
  4.     ON dbo.country(iso_country_code)
  5.     WHERE iso_country_code IS NOT NULL;
  6.   END
  7.  
  8. GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement