时间:2021-07-01 10:21:17 帮助过:6人阅读
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 >‘开始时间‘
ORDER BY
QS.total_elapsed_time DESC
SQL Server查询数据库近期执行的SQL语句
标签:语句 gic serve top ota logic select 逻辑 execution