34,594
社区成员
发帖
与我相关
我的任务
分享
--if object_id('test') is not null
--drop table test
--create table test(id int identity(1,1) not null primary key,
--val varchar(30))
--begin tran
waitfor time '10:18:00'
insert into test
values('')
select max(id) from test
--commit
insert into st_gvar (fvalue) values ('');
-- select max(aid) as c1 from st_gvar; 不用这个
select @@IDENTITY -- 用这个,两个会话互不影响,A先执行A 行到 1,B后执行, B得到的是 2 。