您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

sql server创建复合主键的2种方法

2025/9/17 15:17:22发布24次查看
sql server创建复合主键的2种方法,需要的朋友可以参考一下
创建复合主键:
方法一:创建表之后,alter table table_name add primary key(字段1,字段2)
方法二:create table 表名 (字段名1 int not null,
字段名2 nvarchar(13) not null
字段名3…………
字段名n…………)
go
alter table 表名 with nocheck add
constraint [pk_表名] primary key nonclustered
(
[字段名1],
[字段名2]
)
go
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product