Created
March 21, 2014 07:06
-
-
Save HenrikHoyer/9681053 to your computer and use it in GitHub Desktop.
Show last statements executed on an sql server
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 execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery | |
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql | |
ORDER BY execquery.last_execution_time DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment