Another idea using Extended Events.
Create an extended events session to catch errors
CREATE EVENT SESSION [Track_Errors] ON SERVER
ADD EVENT sqlserver.error_reported(
When my stored procedures run other stored procedures, how can I find
out which stored procedure's code generated the error?
In your CATCH block, you can use ERROR_PROCEDURE() to get the name of the procedure or trigger where the error occurred.
If you simply use THROW in your CATCH block in the inner procedures, then your outer procedure can access these ...
That behavior is expected and is described on the sp_describe_first_result_set doc under the Remarks section:
For each control flow path, the first statement (if any) that returns
a result set is determined by sp_describe_first_result_set.
When multiple possible first statements are found in a batch, their
results can differ in number of columns, column ...
We can get the number of connections active for each trunk/period/interval combination like so:
WITH Numbers(val) AS
val + 1
val < 48
,@period as Period
That should be simple:
ALTER PROCEDURE myproc
SET default_transaction_isolation = 'repeatable read';
The downside to that is that because of the limitations of transaction management inside procedures, you can no longer COMMIT or ROLLBACK inside such a procedure.
If you need that, you could start the procedure body like this:
COMMIT; -- otherwise you ...