--获取一个新的ID
declare @newId bigint
select @newId=MAX(ID) from BdRdRecord01 begin tran
if @newId< or @newId is null
begin
set @newId=
insert into BdRdRecord01(ID,bRdFlag) values (@newId,)
end
else
begin
set @newId=@newId+
insert into BdRdRecord01(ID,bRdFlag) values (@newId,)
end if @newId< or @newId is null
begin
rollback tran ---回滚事务
set @newId=-
end
else
begin
commit tran --执行事务
end select @newId
04-24 14:08