I would like to identify which SSRS reports have been running over 5 minutes but are still running.
The SSRS executionlog only shows an entry AFTER the report has loaded and the below query does not show me the source of long running queries so I can't tie it to a report.
I would like to use this to kill spids of long running reports (in SQL Server 2012).
SELECT st.text,
qp.query_plan,
qs.*
FROM (
SELECT TOP 50 *
FROM sys.dm_exec_query_stats
ORDER BY total_worker_time DESC
) AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp
WHERE qs.max_worker_time > 300
OR qs.max_elapsed_time > 300