--查看指定表的主键
select * from sysobjects where parent_obj in(
select id ,* from sysobjects where name='表名')
and xtype='PK'
--查看所有表
select * from sysobjects where xtype='PK'
--查看指定表的主键
转载于:https://www.cnblogs.com/qingsong-do/archive/2012/03/25/2416533.html