Options

Long running queries - stored procedures

DBdaveDBdave Posts: 14 Bronze 1
edited July 30, 2014 9:00AM in SQL Monitor Previous Versions
If a sproc is captured as a long running query the parameters used to execute the stored procedure are not captured which makes it harder to analyse the issue and makes the alert a little pointless.

Is there a way to find out what was passed into the sproc?

Comments

  • Options
    Thank you for your post.

    SQL Monitor uses a SQL Server table valued function called sys.dm_exec_sql_text (based upon a sql_handle found using the view sys.dm_exec_query_stats) to gather information about queries which are run. These are used in a number of places including the long-running query alert.

    sys.dm_exec_sql_text (Transact-SQL)
    http://msdn.microsoft.com/en-gb/library/ms181929.aspx

    sys.dm_exec_query_stats (Transact-SQL)
    http://msdn.microsoft.com/en-us/library/ms189741.aspx

    The tool uses a complex query to get this information, and unfortunately neither of these hold the parameters specified when running stored procedures. To the best of my knowledge there is no way to retrospectively find these out either.

    I'm sorry that I don't have a better answer for you. But feel free to add any additional questions.
Sign In or Register to comment.