sql server - Get execution count of Stored procedure in SQL 2005 -
we want capture execution count of selective stored procedure on 1 of our databases in sql 2005.
can please advise, how can capture same...with below cached sps data. in our case, want selective sps specific our application
select db_name(st.dbid) dbname ,object_schema_name(st.objectid,dbid) schemaname ,object_name(st.objectid,dbid) storedprocedure ,max(cp.usecounts) execution_count sys.dm_exec_cached_plans cp cross apply sys.dm_exec_sql_text(cp.plan_handle) st db_name(st.dbid) not null , cp.objtype = 'proc' group cp.plan_handle, db_name(st.dbid), object_schema_name(objectid,st.dbid), object_name(objectid,st.dbid) order max(cp.usecounts)
Comments
Post a Comment