34,593
社区成员
发帖
与我相关
我的任务
分享
--drop table tb
create table tb(
id int identity(1,1) primary key,
vv varchar(10)
)
--不需要插入自增列,由sql server会自动增加1,解决了并发的问题
insert into tb(vv)
values('a1')
insert into tb(vv)
values('a2')
insert into tb(vv)
values('a3')
select *
from tb
/*
id vv
1 a1
2 a2
3 a3
*/