--查看指定表的主键

select * from sysobjects where parent_obj in(
select id ,* from sysobjects where name='表名')
and xtype='PK'
--查看所有表
select * from sysobjects where xtype='PK'

 

相关文章: