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)
 Primary Key information

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-12-04 : 09:12:57
shanky writes "How can i retrieve the column names of a table that constitutes the primary key through a SQL query?

Otherwise, which system table i need to look for? Already i tried syscolumns, sysindexes & sysindextypes. Is there any other table i can get the above info?"

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2001-12-04 : 09:30:46
Lookup the views
information_schema.key_column_usage and
information_schema.table_constraints



Go to Top of Page
   

- Advertisement -