SELECT DISTINCT TOP 100
t.TEXT QueryName,
s.execution_count AS ExecutionCount,
s.max_elapsed_time AS MaxElapsedTime,
ISNULL(s.total_elapsed_time / s.execution_count, 0) AS AvgElapsedTime,
s.creation_time AS LogCreatedOn,
ISNULL(s.execution_count / DATEDIFF(s, s.creation_time, GETDATE()), 0) AS FrequencyPerSec
FROM sys.dm_exec_query_stats s
CROSS APPLY sys.dm_exec_sql_text( s.sql_handle ) t
ORDER BY
AvgElapsedTime DESC
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26477398/viewspace-2122448/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26477398/viewspace-2122448/