删除(添加)主键约束

删除主键

alter table 表名 drop constraint 主键名

删除之前先查询下系统表中的主键

select* from sysobjects where xtype ='pk '

添加主键

alter table 表名 add primary key (字段名)

------------------------------

alter table 同样可以删除,添加表结构的字段(DB2数据库不能删除字段)

原文地址:https://www.cnblogs.com/lucky9/p/6249363.html