|
Each contribution is licensed to you under a License Agreement by its owner, not Microsoft. Microsoft does not guarantee the contribution or purport to grant rights to it.
|
Categories |
List Currently-Execu
(Microsoft)
|
|
VERIFIED AND TESTED BY THE SCRIPT CENTER TEAM |
|
select qs.sql_handle, qs.statement_start_offset, qs.statement_end_offset, q.dbid, q.objectid, q.number, q.encrypted, q.text from sys.dm_exec_query_stats qs cross apply sys.dm_exec_sql_text(qs.plan_handle) as q where qs.total_worker_time > qs.total_elapsed_time
| Windows Server 2008 R2 | No |
| Windows Server 2008 | No |
| Windows Server 2003 | No |
| Windows 7 | No |
| Windows Vista | No |
| Windows XP | No |
| Windows 2000 | No |
|
|
This query does not contain any reference to exec_context_id
select r.session_id, r.request_id, max(isnull(exec r.sql_handle, r.statement_sta r.statement_end r.plan_handle from sys.dm_exec_req join sys.dm_os_tasks t on r.session_id = t.session_id join sys.dm_exec_ses where s.is_user_proce group by r.session_id, r.request_id, r.sql_handle, r.plan_handle, r.statement_sta having max(isnull(exec
Written
October 20, 2009
|
|
|