select COL_NAME(object_id('表名'),c.colid)from sysobjects a,sysindexes b,sysindexkeys cwhere a.name=b.name and b.id=c.id and b.indid=c.indidand a.xtype='PK' and a.parent_obj=object_id('表名')and c.id=object_id('表名')
本文共 262 字,大约阅读时间需要 1 分钟。
select COL_NAME(object_id('表名'),c.colid)from sysobjects a,sysindexes b,sysindexkeys cwhere a.name=b.name and b.id=c.id and b.indid=c.indidand a.xtype='PK' and a.parent_obj=object_id('表名')and c.id=object_id('表名')
转载于:https://www.cnblogs.com/xyz0835/p/3352385.html