Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

"Call Stack"

Provide DMV to provide the call stack of stored procedures, triggers, CLR functions etc prefferable in JSON format so it is parsable.

As Erland Sommarskog says this is available but only in the "event Blocked Process Report:

<executionStack>
<frame line="17" stmtstart="1332" stmtend="2906" sqlhandle="0x03000d00399f00558c840601a29800000100000000000000"/>
<frame line="1" sqlhandle="0x01000d00638e300f302e10ac000000000000000000000000"/>
</executionStack>

That is, here the call stack is available. Through the sqlhandle it is possible to retrieve
the objectids of the calling procedures.

If if it's available this way, it can't be too difficult to expose this in a DMV. Only exposing the
sqlhandle would not match with my observation with permissions above, but since you probably
only want this code in a few places, this could be dealt with adding extra privs with
certificate signing."

This is already requested in connect items 124537 and 2781373.

54 votes
Sign in
(thinking…)
Password icon
Signed in as (Sign out)

We’ll send you updates on this idea

David 'justdave' Williams shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base