新建一表,存最大值,每次取最大值的同时,将最大值加一。
declare @t table(cid int)
update maxid
set cid=cid+1 output deleted .cid
into @t
select * from @t
新建一表,存最大值,每次取最大值的同时,将最大值加一。
declare @t table(cid int)
update maxid
set cid=cid+1 output deleted .cid
into @t
select * from @t