SELECT TOP 1000 QS.creation_time, SUBSTRING(ST.text, (QS.statement_start_offset / 2) + 1, ((CASE QS.statement_end_offset WHEN - 1 THEN DATALENGTH(st.text) ELSE QS.statement_end_offset END - QS.statement_start_offset) / 2) + 1) AS statement_text, ST.text, QS.total_worker_time, QS.last_worker_time, QS.max_worker_time, QS.min_worker_time FROM sys.dm_exec_query_stats QS CROSS APPLY sys.dm_exec_sql_text(QS.sql_handle) ST WHERE QS.creation_time BETWEEN ‘2019-08-24 11:27:16‘ AND ‘2019-08-24 18:00:00‘ AND ST.text LIKE ‘%emw_skzy101..M_WMS_SU_HIS%‘ ORDER BY QS.creation_time DESC
原文地址:https://www.cnblogs.com/CandiceW/p/11405392.html
时间: 2024-10-10 08:46:53