Find Queries Using Most CPU
-
Posted on May 31, 2009 by Derek Dieter
-
-1
[cc lang=”sql”]
SELECT TOP 5
object_name(objectID)
,[Avg CPU Time] = total_worker_time/execution_count
,execution_count
,Plan_handle
,query_plan
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle)
ORDER BY total_worker_time/execution_count DESC;
[/cc]
Post a comment
- Comments (RSS)
- Trackback
- Permalink