begin try begin transaction tc SQL 操作 commit transaction tc end try begin catch rollback transaction tc print '捕捉到了错误,回滚' end catch go select * from tablename