Posts

Showing posts with the label SP

Stored Procedure Execution Statistics SQL

Image
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 AvgWor...