Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mehmetcantas/1f2cf2092f241597cb19e66ca03bf0bc to your computer and use it in GitHub Desktop.
Save mehmetcantas/1f2cf2092f241597cb19e66ca03bf0bc to your computer and use it in GitHub Desktop.
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