T-SQL: Top most used stored procedures

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
Default image
Bart
Articles: 80