All right, go to the database log to search for it and use the time and keyword for batch configuration .. You can use all that you can think.
First, assume that you have executed it. No? Okay, either it's too simple, or you're too simple ..
Copy codeThe Code is as follows:
Select top 1000
-- Creation Time
QS. creation_time,
-- Query statement
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,
-- Execution text
ST. text,
-- Execution plan
QS. total_worker_time,
QS. last_worker_time,
QS. max_worker_time,
QS. min_worker_time
FROM
Sys. dm_exec_query_stats QS
-- Keyword
CROSS APPLY
Sys. dm_exec_ SQL _text (QS. SQL _handle) ST
WHERE
QS. creation_time BETWEEN '2017-10-20 16:00:00 'AND '2017-10-20 17:00:00'
And st. text LIKE '%'
ORDER
QS. creation_time DESC
The cross apply and outer apply join statements added by SQL Server 2005 are used to join Table value functions (functions that return the table result set ), more importantly, the parameter of this function is a field in another table.
[SQL Server] CROSS APPLY and OUTER APPLY