Long running queries - stored procedures

Monitor, diagnose and receive alerts to problems across your SQL Servers.

Long running queries - stored procedures

Postby DBdave » Tue Jul 29, 2014 11:11 am

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?
Posts: 8
Joined: Thu Oct 03, 2013 10:21 am

Postby chriskelly » Wed Jul 30, 2014 1:00 pm

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)

sys.dm_exec_query_stats (Transact-SQL)

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.
Posts: 373
Joined: Mon Apr 19, 2010 12:44 pm
Location: Cambridge, UK

Return to SQL Monitor Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests