Unanswered: Top 50 CPU intensive queries, what's wrong with this query?
I was given this query to check the top 50 CPU intensive queries in the SQL server. However, I can't parse it....any idea what went wrong?
SELECT TOP 50 (a.total_worker_time/a.execution_count) as [Avg_CPU_Time],
Convert(Varchar,Last_Execution_Time) as 'Last_execution_Time',
(case when a.statement_end_offset= -1 then len(convert(nvarchar(max), b.text)) * 2
a.statement_end_offsetend -a.statement_start_offset)/2) as Query_Text,
sys.dm_exec_sql_text(a.sql_handle) as b