begin transaction
declare @sumerror int
set @sumerror=0
update bank set ballance=ballance-112 where id="xxx";
set @sumerror=@sumerror+@@error
update bank set ballance=ballance+112 where id="yyy";
set @sumerror=@sunerror+@@error;
if(@sumerror=0)
{
begin
commit transaction
end
}
else{
rollback
}