Which query taken long time(Seconds), Executed at what time

PandianS
Posted by PandianS under Sql Server category on | Points: 40 | Views : 1932
The following query listout the Query which took long time, What time executed
SELECT	R.[Text] 'Query Used', 
((q.Last_Elapsed_Time/1000.)/1000.) 'Time Taken (Seconds)',
q.Last_Execution_Time 'Executed Time'
FROM sys.dm_exec_query_stats q
CROSS APPLY SYS.DM_EXEC_SQL_TEXT(q.Plan_Handle) R
ORDER BY q.Last_Elapsed_Time DESC

Comments or Responses

Login to post response