-
select TOP 1000 *from (SELECT
--创建时间
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 ) as aa where aa.statement_text like'%delete from ExitStripProcess%'
and
aa.creation_time between '2017-11-01 08:37:16.983' and'2017-11-04 08:37:16.983'
转载于:https://www.cnblogs.com/ptisagoodman/p/7813602.html