mssql資料庫的主鍵約束中,主鍵名查詢: 修改主鍵名稱的方法: ...
- mssql資料庫的主鍵約束中,主鍵名查詢:
exec sp_pkeys '數據表名'
- 修改主鍵名稱的方法:
--第一步,刪除主鍵約束
alter table 表名 drop constraint 主鍵名;
--第二步,添加主鍵約束
alter table 表名 add constraint 主鍵名 primary key(欄位名);
mssql資料庫的主鍵約束中,主鍵名查詢: 修改主鍵名稱的方法: ...
exec sp_pkeys '數據表名'
--第一步,刪除主鍵約束
alter table 表名 drop constraint 主鍵名;
--第二步,添加主鍵約束
alter table 表名 add constraint 主鍵名 primary key(欄位名);