How to rollback and stop execution from inner procedure
===

Let's say I have two stored procedures, `Outer` and `Inner`:

    CREATE PROCEDURE dbo.Outer
    AS
    BEGIN
      SET NOCOUNT ON;
      SET XACT_ABORT ON;
      
      BEGIN TRAN
        EXEC Inner

        -- Perform additional processing (which should not occur if there is 
        -- a ROLLBACK in Inner)
        ...
      COMMIT
    END;
    GO

The `Outer` stored procedure turns on XACT_ABORT and starts an explicit transaction. It then calls the `Inner` stored procedure inside the transaction.

    CREATE PROCEDURE dbo.Inner
    AS
    BEGIN
      DECLARE @Id INT=(SELECT Id FROM SomeTable WHERE ...);
    
      IF (@Id IS NOT NULL)
        ROLLBACK;
    
      INSERT INTO SomeTable(...)
      VALUES (...);
    END;
    GO

The `Inner` stored procedure performs a check to see if something is present and if it is wants to rollback the entire transaction started in the `Outer` stored proc and abort all further processing in both `Inner` and `Outer`.

The thing that happens instead of what I expect as outlined above, is that I get the error message:

In Inner:

> Transaction count after EXECUTE indicates a mismatching number of
> BEGIN and COMMIT statements. Previous count = 1, current count = 0.

In Outer:

> The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

Clearly, the `ROLLBACK` even with XACT_ABORT turned on does not stop the flow of execution. Putting a `RETURN` statement after the `ROLLBACK` gets us out of `Inner`, but execution in `Outer` continues. What do I need to do in order to cause the ROLLBACK to stop all further processing and effectively cause an exit out of `Outer`?

Thanks for any help.
