SELECT TOP 1000
ST.text AS '執行的SQL語句',
QS.execution_count AS '執行次數',
QS.total_elapsed_time AS '耗時',
QS.total_logical_reads AS '邏輯讀取次數',
QS.total_logical_writes AS '邏輯寫入次數',
QS.total_physical_reads AS '物理讀取次數',
QS.creation_time AS '執行時間' ,
QS.*
FROM sys.dm_exec_query_stats QS
CROSS APPLY
sys.dm_exec_sql_text(QS.sql_handle) ST
WHERE QS.creation_time BETWEEN '2015-08-01 00:00:00' AND '2015-09-02 11:00:00'
ORDER BY
QS.total_elapsed_time DESCsql
轉:https://blog.csdn.net/weixin_41715295/article/details/79649065.net