这是场景:
下面是复制场景的代码.
create procedure sproc_c
as
RAISERROR('An error is found', 11, 1)
go
create procedure sproc_b
as
exec dbo.sproc_c;
go
create procedure sproc_a
as
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON
SET NOCOUNT ON
SET XACT_ABORT ON
SET ANSI_WARNINGS OFF
declare @transactionName as varchar(50) = '[POC]';
begin tran @transactionName
save tran @transactionName
exec dbo.sproc_b;
commit tran @transactionName
go
CREATE PROCEDURE [test sproc_a]
AS
-- Assert
BEGIN …
Run Code Online (Sandbox Code Playgroud)