存储过程
CREATE PROCEDURE [dbo].[proc_test] @success bit out, @id int as begin Set NOCOUNT ON; Set XACT_ABORT ON; begin try begin tran transtest --begin ----。。。。 --end set @success = 1 commit tran transtest end try begin catch if @@trancount > 0 rollback tran transtest set @success = 0 end catch end