En Fazla Calistirilan StoredProcedure veya Trigger - ISMAIL
Definition Description
SELECT DB_NAME(st.dbid) DatabaseName , cp.objtype , OBJECT_SCHEMA_NAME(st.objectid,dbid) + '.'+OBJECT_NAME(st.objectid,dbid) StoredProcedure , MAX(cp.usecounts) ExecutionCount FROM sys.dm_exec_cached_plans cp CROSS APPLY sys.dm_exec_sql_text (cp.plan_handle) st WHERE DB_NAME(st.dbid) IS NOT NULL AND cp.objtype = 'proc' OR cp.objtype = 'Trigger' GROUP BY DB_NAME(st.dbid),cp.objtype,OBJECT_SCHEMA_NAME(st.objectid,dbid) + '.'+OBJECT_NAME(st.objectid,dbid) ORDER BY MAX(cp.usecounts) DESC