删除主键

alter table 表名 drop constraint 主键名

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

select* from sysobjects where xtype ='pk '

添加主键

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

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

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

相关文章:

  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2021-04-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-09-03
  • 2021-06-29
  • 2021-12-27
相关资源
相似解决方案