top of page

Query to find Storedprocedure with the highest total workertime in SQL Server

SELECT TOP (10) sp.database_id,

so.name AS StoredProcName,

sp.total_worker_time,

sp.execution_count,

sp.total_logical_reads,

sp.total_logical_writes,

sp.total_logical_reads

FROM sys.dm_exec_procedure_stats AS sp

INNER JOIN sys.objects AS so

ON (sp.object_id = so.object_id)

WHERE so.type = 'P' AND sp.database_id = DB_ID()

ORDER BY sp.total_worker_time DESC;

GO

4 views0 comments

Recent Posts

See All

Comentarios


bottom of page