Skip to content

Instantly share code, notes, and snippets.

@PRElias
Created September 4, 2018 14:19
Show Gist options
  • Save PRElias/4d1d065ef3af26f7832b01222e75f004 to your computer and use it in GitHub Desktop.
Save PRElias/4d1d065ef3af26f7832b01222e75f004 to your computer and use it in GitHub Desktop.
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
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