SQL表中,把表中已有字段设置为主键

SQL表中,把表中已有字段设置为主键
2025-03-14 23:29:59
推荐回答(2个)
回答1:

Alter table 表名 Add Constraint PrimaryKey Primary Key (主键字段名)

回答2:

alter table 表名 add constraint 关联表名 primary key(列名);