Stored Procedure Execution history

  • Hi,

    Can we get the information of a Stored Procedure like when it is executed lastly or the history of the execution ?

    Thanks in Advance!

  • Not unless you had some type of monitoring or tracing in place. This isn't captured by default.

  • Although, you can see an aggregate history of the executions in cache. If you look at sys.dm_exec_query_stats you can find an aggregation of performance metrics for any query still in cache. It'll help, but Steve's right. To really get a full history, you have to set up monitoring. I'd suggest looking into extended events.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply