Find Queries Using Most CPU

[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]

Featured Articles

 Site Author

  • Thanks for visiting!
css.php