Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Find constraint columns in a table

Author  Topic 

brlele
Starting Member

3 Posts

Posted - 2004-01-15 : 08:03:19
Hi
I want to know the names of the columns in a table having primary key and unique key/index . If the key/index is composite then I should get the list of the column names which make composite key/index.

The system stored procedure sp_pkeys helps in case of composite primary keys but I do not have any idea about how to find out unique keys/index column names .

harshal_in
Aged Yak Warrior

633 Posts

Posted - 2004-01-15 : 08:05:31
you can use sp_help

He is a fool for five minutes who asks , but who does not ask remains a fool for life!
Go to Top of Page

raymondpeacock
Constraint Violating Yak Guru

367 Posts

Posted - 2004-01-15 : 10:02:56
Have you tried sp_MSHelpIndex? It lists all indexes on a table and the columns that form part of each index. Be aware it is undocumented though.


Raymond
Go to Top of Page
   

- Advertisement -