Select Top -
Qs.creation_time,
Last_execution_time,total_physical_reads,total_logical_reads,total_logical_writes,
db_name(dbid) Dbname,execution_count,--Total_worker_time,Last_worker_time,--substring (CONVERT (char), DATEADD (ms,total_worker_time/1000,0), 121), 12,23) Total_worker_time,--Total_elapsed_time,Last_elapsed_time,substring(Convert(Char( at),DATEADD(Ms,total_elapsed_time/ +,0),121), A, at) Total_elapsed_time,--Total_elapsed_time/execution_count Avg_elapsed_time,substring(Convert(Char( at),DATEADD(MS, (Total_elapsed_time/Execution_count)/ +,0),121), A, at) Avg_elapsed_time,SUBSTRING(St.text, (Qs.statement_start_offset/2)+ 1,(( CaseStatement_end_offset when -1 Then datalength(St.text)ELSEQs.statement_end_offsetEND -Qs.statement_start_offset)/2)+ 1) asstatement_text fromSys.dm_exec_query_stats asQS CrossAPPLY sys.dm_exec_sql_text (qs.sql_handle) St--ORDER by execution_count desc Schedule Total number of executions--ORDER by Total_elapsed_time--Total planned execution durationOrder byLast_worker_timedesc;--last execution CPU elapsed time
SQL Server Monitoring statements