What I\'d like to be able to do in SQL Server 2005 somehow is with a table name as input determine all the fields that make up the primary key. sp_columns doesn
I ended up using this...
select cu.constraint_catalog,
cu.constraint_schema,
cu.table_name,
cu.constraint_name,
constraint_type,
column_name,
ordinal_position
from information_schema.key_column_usage cu
join information_schema.table_constraints as tc
on tc.constraint_catalog = cu.constraint_catalog and
tc.constraint_schema = cu.constraint_schema and
tc.constraint_name = cu.constraint_name and
tc.table_name = cu.table_name
where cu.table_name = 'table_name_goes_here'
order by constraint_name, ordinal_position