Hello all
I have 2 stored procedures that run a bunch of updates/appends/deletes. The first SP runs a few updates (each with rollback transactions), then calls the second procedure.
I need to rollback whatever this second SP does if it fails, and rollback all transactions in the first SP.
The code goes a little like this:
ALTER PROCEDURE "spAppendPostPrintData" AS
Begin Transaction
INSERT INTO dbo.tblPrintRecord (HubeAccNo, SERVICE_NO)
SELECT HubeAccNo, SERVICE_NO
FROM dbo.tblSalesOppsPrint
IF @@ERROR <>0
BEGIN
ROLLBACK TRAN
RETURN
END
EXEC spAppendPostPrintData2
COMMIT TRANSACTION
I want to rollback the EXEC command, and all that goes before it.
Hope that makes sense!
Cheers
J
I have 2 stored procedures that run a bunch of updates/appends/deletes. The first SP runs a few updates (each with rollback transactions), then calls the second procedure.
I need to rollback whatever this second SP does if it fails, and rollback all transactions in the first SP.
The code goes a little like this:
ALTER PROCEDURE "spAppendPostPrintData" AS
Begin Transaction
INSERT INTO dbo.tblPrintRecord (HubeAccNo, SERVICE_NO)
SELECT HubeAccNo, SERVICE_NO
FROM dbo.tblSalesOppsPrint
IF @@ERROR <>0
BEGIN
ROLLBACK TRAN
RETURN
END
EXEC spAppendPostPrintData2
COMMIT TRANSACTION
I want to rollback the EXEC command, and all that goes before it.
Hope that makes sense!
Cheers
J