SQL server双主键或多主键设置(两种方式)

分类: 365bet官网提现说维护 时间: 2025-11-05 11:35:17 作者: admin

双主键

alter table [数据表名] with nocheck add

constratint [PK_主键名字] primary key nonclustered

(

[字段名1],

[字段名2]

)

多主键

alter table [数据表名] with nocheck add

constratint [PK_主键名字] primary key nonclustered

(

[字段名1],

[字段名2],

。。。。

[字段n]

)

设计里面主键设置流程(按住Ctrl不松开,然后选中你需要的主键)