Created
November 3, 2023 15:07
-
-
Save ststeiger/fc6834a972bffbc9847cd86db2db03a3 to your computer and use it in GitHub Desktop.
View last executed SQL queries
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] | |
FROM sys.dm_exec_query_stats AS deqs | |
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest | |
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