Last active
February 18, 2021 08:45
-
-
Save alaawahbah/b1bde015b4d06f698ce0896138e9d6c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT deqs.last_execution_time AS [Time], | |
dest.text AS [Query], | |
dest.* | |
FROM sys.dm_exec_query_stats AS deqs | |
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest | |
--WHERE dest.dbid = DB_ID('msdb') | |
where dest.text like '%delete %' | |
ORDER BY deqs.last_execution_time DESC | |
--SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.* | |
--FROM sys.dm_exec_query_stats AS deqs | |
--CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest | |
--WHERE dest.dbid = DB_ID('msdb') | |
--ORDER BY deqs.last_execution_time DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment