Hi,
Use the below Query:-
select a.table_name, b.column_name, a.constraint_name from
information_schema.TABLE_CONSTRAINTS
a,information_schema.CONSTRAINT_COLUMN_USAGE b
where a.constraint_name=b.constraint_name
and a.table_name=b.table_name
and constraint_type='UNIQUE'
Thanks
Hari
MCDBA
"nima" <anonymous (AT) discussions (DOT) microsoft.com> wrote
Quote:
Hello everyone,
I am trying to write a query to get a list of unique constraints in my
database. I want the constraint name, table name, and column names. I get
|
everything fine except for the column names. sysconstraints' colid column
has zeros instead of values. How can I get a list of the columns used in my
unique constraints?
Quote:
Thanks a bunch in advance for your help. |