BEGIN TRAN -- 做某些操作,例如Insert into … if @@error <> 0 BEGIN ROLLBACK TRAN END else BEGIN COMMIT TRAN END