双主键
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不松开,然后选中你需要的主键)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/f09754448c1d896f510f6e5fbe19f20f.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/260a1a355345b7df0f2827c4f3f14d5e.png)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/861d39ce749017a74aa63b6c873eeb06.png)