views:

109

answers:

1

I have a table with a unique constraint on one or more fields. Given the constraint name, I want to query the system views to get the list of fields that are part of this constraint.

SQL Server 2005.

Thanks.

A: 

Look at information_schema.constraint_column_usage

select column_name from information_schema.constraint_column_usage
where constraint_name = 'your constraint'
cmsjr
Perfect, thanks!
Erick Sasse