Jay,
In this case, you can just call the stored procedure sp_pkeys, passing
in the name of the table, and it will return a recordset with the columns
that make up the primary key for the table.
If you want to get your hands dirty with the system views, then this is
the query you would run in SQL Server 2005:
select
sc.*
from
sys.indexes as si
inner join sys.index_columns as sic on
sic.object_id = si.object_id and
sic.index_id = si.index_id
inner join sys.columns as sc on
sc.object_id = sic.object_id and
sc.column_id = sic.column_id
where
si.is_primary_key <> 0 and
si.object_id = object_id('?')
order by
sic.key_ordinal
Just replace ? with the name of the table in your database.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Nicholas,
>
[quoted text clipped - 14 lines]
>> > information
>> > I put in it, not information from the database...