在直接用T-SQL语言创建表的时候,如果要创建表的主键,一般用primary key,比如:
create table test_2([id] int primary key,[no] varchar(20))
insert test_1(id,no)
select '1','1' union all
select '2','2' union all
select '3','3'
那如果要两列同时作为主键,该怎么写呢?
...全文
9014打赏收藏
sql设置主键问题
在直接用T-SQL语言创建表的时候,如果要创建表的主键,一般用primary key,比如: create table test_2([id] int primary key,[no] varchar(20)) insert test_1(id,no) select '1','1' union all select '2','2' union all select '3','3' 那如果要两列同时作为主键,该怎么写呢?