T-SQL: Top most used stored procedures

Bschelst/ February 11, 2019/ SQL-Server/ 0 comments

The code below will give you the top 10 most executed stored procedures in your database, sorted by execution count.

SELECT TOP 10 dest.text, deqs.execution_count,
deqs.total_worker_time, dest.objectid
FROM sys.dm_exec_query_stats deqs
CROSS APPLY sys.dm_exec_sql_text (deqs.sql_handle) dest
ORDER BY deqs.execution_count desc
Share this Post

Leave a Comment

Your email address will not be published. Required fields are marked *