Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JustinMcNamara74/a38f9e3763dd5e998e213f92a1ca5760 to your computer and use it in GitHub Desktop.
Save JustinMcNamara74/a38f9e3763dd5e998e213f92a1ca5760 to your computer and use it in GitHub Desktop.
Lists the most recently executed SPs in descending order.
SELECT DB_NAME(database_id)
,OBJECT_NAME(object_id)
,cached_time
,last_execution_time
,execution_count
FROM sys.dm_exec_procedure_stats
WHERE DB_NAME(database_id) = 'DB_NAME'
ORDER BY last_execution_time DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment