Stored Procedure Execution Statistics SQL

SELECT ISNULL(DBS.name, '') AS DatabaseName

      ,OBJECT_NAME(EPS.object_id, EPS.database_id) AS ObjectName

      ,EPS.cached_time AS CachedTime

      ,EPS.last_elapsed_time AS LastElapsedTime

      ,EPS.execution_count AS ExecutionCount

      ,EPS.total_worker_time / EPS.execution_count AS AvgWorkerTime

      ,EPS.total_elapsed_time / EPS.execution_count AS AvgElapsedTime

      ,(EPS.total_logical_reads + EPS.total_logical_writes)

       / EPS.execution_count AS AvgLogicalIO

FROM sys.dm_exec_procedure_stats AS EPS

     LEFT JOIN sys.databases AS DBS

            ON EPS.database_id = DBS.database_id

ORDER BY AvgWorkerTime DESC;

 

 

Comments

  1. Great article, Thank you for sharing this valuable info with us.

    ReplyDelete

Post a Comment

Hi User,
Thanks for visiting My Blog and please provide your valuable feedback and subscribe for more updates. Please don't post any spam content or comments.
Thank You

Popular Posts

Failed to execute the package or element. Build errors were encountered

Restore of database 'DataBase_Name' failed. (Microsoft.SqlServer.Management.RelationalEngineTasks)

Cannot convert "Column" between a unicode and a non-unicode string data types in SSIS