Saturday 17 February 2018

MSSQL - Query to show when specified stored procedure was executed for the last time

Watch this example on YouTube


Select TOP(1) last_execution_time
FROM sys.dm_exec_procedure_stats
WHERE (OBJECT_NAME(object_id, database_id) = 'NAME OF THE STORED PROCEDURE')
ORDER BY last_execution_time DESC

1 comment:

  1. Thanks, I can't believe how hard this was to find.

    ReplyDelete