|
Posted by boblotz2001 on 10/31/05 22:25
select t.table_name, t.constraint_type, t.constraint_name,
c.column_name
from information_schema.TABLE_CONSTRAINTS t
join information_schema.CONSTRAINT_COLUMN_USAGE c ON t.constraint_name
= c.constraint_name
where constraint_type IN ('UNIQUE', 'PRIMARY KEY')
and t.table_name = <Table Name>
Akintoye Olorode wrote:
> Hello All,
>
> Could someone help provide a query that I can run to
> determine the primary key and unique columns for any
> given table ?
>
> Thanks in Advance,
>
> Akintoye
Navigation:
[Reply to this message]
|