I need to find list of unique indices that does not have unique constraint on that column. How to achieve this?
I know, following query will give me unique constraints.
SELECT *
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
WHERE CONSTRAINT_TYPE='UNIQUE'
Note: I am using SQL Server 2012.
Best Answer
sys.indexes
includes columns that identify if the index is unique, supports a unique constraint, or supports a primary key constraint. The query below lists unique indexes that do not support a constraint: