Last Execution Time Of A Stored Procedure

Sometime it is a critical question that when a stored procedure is run. Because if you want to drop a stored procedure which is not used any more, you must be sure that it is not used.
So with the system view "sys.dm_exec_procedure_stats" you can get this information. The "last_execution_time" column tells this.
Of course, since this is a system view, this info dates back to SQL Server service start up time. To be sure, enough time must be elapsed. At the same time the related procedure must not be removed from the cache.
 This has view has lots of useful information like execution count, max physical reads etc...


No comments:

Post a Comment