begin try --位置A ...--查询代码,以及其他设置变量的代码 --位置B begin transaction 事务代码 commit transaction end try begin catch end catch