Skip to content

Instantly share code, notes, and snippets.

@NoahDragon
Last active February 25, 2016 22:19
Show Gist options
  • Save NoahDragon/95fe0dc45d3b4dd5b3c5 to your computer and use it in GitHub Desktop.
Save NoahDragon/95fe0dc45d3b4dd5b3c5 to your computer and use it in GitHub Desktop.
Get SQL Server Stored Procedure last run time.
-- Check last time SP ran.
select b.name, a.last_execution_time
from sys.dm_exec_procedure_stats a
inner join sys.objects b
on a.object_id = b.object_id
where DB_NAME(a.database_ID) = DB_NAME() -- Current database or change it to your database name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment