begin trybegin transaction trselect * from Car_Brandupdate car_log set [reason]='ceshiceshiceshi' where [modelid]=557;select 1/0print 'i have executed!'select * from AREAprint 'executed success';commit transaction tr <-----------------------------------------------end trybegin catchprint 'executed failed';rollback transaction trend catch
1 回答
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
begin catch ... end catch 里的内容,只有在 begin try ... end try 里的内容执行有错误才会触发到,所以, commit tran 执行成功的话,是不会执行到 rollback tran 的
- 1 回答
- 0 关注
- 266 浏览
添加回答
举报
0/150
提交
取消