How do I get the names of all the columns in the primary key using TSQL in a form I can loop round with a cursor.
Assume I know how to get the table id from sysobjects and the column names from syscolumns (and I know I shouldn't really be using the system tables!)?