exec sp_pkeys '數據表名'
--第一步,刪除主鍵約束 alter table 表名 drop constraint 主鍵名; --第二步,添加主鍵約束 alter table 表名 add constraint 主鍵名 primary key(字段名);