If I create a Stored Procedure in SQL and call it (EXEC spStoredProcedure
) within the BEGIN/END TRANSACTION, does this other stored procedure also fall into the transaction?
I didn't know if it worked like try/catches in C#.
If I create a Stored Procedure in SQL and call it (EXEC spStoredProcedure
) within the BEGIN/END TRANSACTION, does this other stored procedure also fall into the transaction?
I didn't know if it worked like try/catches in C#.
I believe in MS SQL Server the stored procedure execution would happen within the transaction, but be very careful with this. If you have nested transactions (ie, transaction outside of the stored procedure and a different transaction inside the stored procedure), a rollback will affect ALL of the transactions, not just the nearest enclosing transaction.