You can use SQL Profiler to find out by which procedure the second procedure
is called if you trace the SQL:StmtStarted or SQL:StmtCompleted events.
If you trace the following:
CREATE PROC usp_inner
CREATE PROC usp_outer
DROP PROC usp_outer, usp_inner
You will see
in the TextData column of your trace. The commented out bit is the calling
procedure. Even when you execute a variable procedure name, you can still
find out the calling procedure, because the calling procedure name will be
in the event before the first event that includes the called procedure's
name (like the example above)
SQL Server MVP
> Is there any way to get an object ID for the the stored procedure or
> that called the currently executing stored proc?
> or trigCallingTrig .. then I want the object id for that calling proc /
> This is all for debugging something on our system.