brgdotnet
asked on
How to query for the primary key names of a table?
I have a query which will find all column names for a table. It works great, however I need a query that will somehow tell me which of the columns are primary keys for the table. Does anyone know how to do this? Here is my sql query :
select TABLE_CATALOG as dBName, TABLE_NAME, COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='abc'
select TABLE_CATALOG as dBName, TABLE_NAME, COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME='abc'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.