34,590
社区成员
发帖
与我相关
我的任务
分享
if @value is null return
begin try
begin transaction
update xxxx
set
where sid=@id and eid=@eid and type=@type
if @@rowcount =0
insert into xxx ....
commit transaction
end try
begin catch
declare @Error nvarchar(2047)
set @Error = error_message()
raiserror 50001 @Error
if @@trancount > 0
rollback transaction
end catch