Skip to content

SQL Query consuming high CPU

You can run below query to find the top 20 queries that are consuming high CPU. This query will pull data from dm_exec_query_stats DMV and will be very useful in scenarios when your SQL Server is consuming high CPU.

select top 20 * from sys.dm_exec_query_stats qs cross apply sys.dm_exec_sql_text(qs.sql_handle) order by total_worker_time desc[\sql]