I'm writing a stored procedure which manipulates a table whose name must be given as a parameter. The stored procedure needs the primary key column name (by design the primary key must have only one column), and I thought I could get this from the system table instead of having to provide it as a parameter. So I need to put the primary key column name in a variable.
The best way I found so far is this : declare @keyname nvarchar(1024)
create table #keys (table_qualifier nvarchar(255),table_owner nvarchar(255),table_name nvarchar