sqlServer 组合主键
创建表时:
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
create table Person ( Name1 nvarchar(10) not null ,Name2 nvarchar(10) not null primary key(Name1,Name2) ,Age int not null ,Sex char(2) ) go
效果如下图:
表创建后:
sqlServer 组合主键
创建表时:
create table Person ( Name1 nvarchar(10) not null ,Name2 nvarchar(10) not null primary key(Name1,Name2) ,Age int not null ,Sex char(2) ) go
效果如下图:
表创建后:
转载于:https://www.cnblogs.com/zlp520/p/3599305.html