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

Add a function that returns the tsql_stack

In sys.dm_exec_requests you have a sql_handle, statement_start_offset, and statement_end_offset. This can be used to give you the currently executing stored procedure / function and statement.

It would be nice if you also could get the complete callstack. This information is available as xml in the extended event action [tsql_stack].

I would like to have a function that takes session_id and request_id as parameters, and returns the tsql_stack.

2 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    AdminMicrosoft SQL Server (Admin, Microsoft Azure) shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    under review  ·  AdminMicrosoft SQL Server (Admin, Microsoft Azure) responded  · 

    Upvotes: 6

    <=-=Sep 20 2017 1:09PM=-=>

    So this is generalisation of my item http://connect.microsoft.com/SQLServer/feedback/details/2781373. Provided that the DMV is implemented so that the current spid and request can get its stack without VIEW SERVER STATE, the function Ola calls for, meet my needs to.

    <=-=Jan 3 2018 8:31AM=-=>

    Thanks for the suggestion. We’ll keep this item open for future consideration.

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base