To view all unique constraints in a database in MSSQL, use below auery.
select TC.Constraint_Name, CC.Column_Name, CC.TABLE_NAME from information_schema.table_constraints TC inner join information_schema.constraint_column_usage CC on TC.Constraint_Name = CC.Constraint_Name where TC.constraint_type = 'Unique'
order by TC.Constraint_Name;
select TC.Constraint_Name, CC.Column_Name, CC.TABLE_NAME from information_schema.table_constraints TC inner join information_schema.constraint_column_usage CC on TC.Constraint_Name = CC.Constraint_Name where TC.constraint_type = 'Unique'
order by TC.Constraint_Name;
Comments
Post a Comment