數據庫主鍵約束

  • mssql數據庫的主鍵約束中,主鍵名查詢:
exec sp_pkeys '數據表名'
  • 修改主鍵名稱的方法:
--第一步,刪除主鍵約束
alter table  表名 drop constraint 主鍵名;
--第二步,添加主鍵約束
alter table 表名 add constraint 主鍵名 primary key(字段名);
相關文章
相關標籤/搜索