这里有表的连接关系:
declare @object_id int
set @object_id=object_id('ta')
select name from syscolumns where id=@object_id and colid in(
select colid from sysindexkeys where @object_id=id and indid in(
select indid from sysindexes where @object_id=id and name in(
select name from sysobjects where xtype='PK' and parent_obj=@object_id
)))