你好,可以查看表结构,或者利用系统表sysobjects查询(放在脚本里面写)。select * from sysobjects where parent_obj in (select id from sysobjects where name='表名') and xtype='pk',查出来的第一个字段就是主键了.
也可以第一种方法查看,利用表的结构,字段前面有个钥匙图标的就是主键啦,如下图:
select ident_current('表名')