create procedure dd @id int begin transaction update table #temp set id=@id where column1=2 if @error <> 0 goto roll update table #temp2 set id=@id where column1=2 if @error<>0 goto roll commit transcation return 0 roll: print('fail') rollback transcation return 1
begin transaction
update table #temp set id=@id where column1=2
if @error <> 0 goto roll
update table #temp2 set id=@id where column1=2
if @error<>0 goto roll
commit transcation
return 0
roll:
print('fail')
rollback transcation
return 1