zaagan
8/10/2019 - 2:37 PM

MS SQL Unique Index

MS SQL Unique Index

IF EXISTS (SELECT name from sys.indexes  
           WHERE name = N'index_name')   
   DROP INDEX index_name ON schema.tableName;   
GO  

CREATE UNIQUE INDEX index_name   
   ON schema.tableName (colName);   
GO