SQLServer 查看存储过程执行次数的方法
select db_name(st.dbid) as database_name, object_name(st.objectid) as name, p.size_in_bytes / 1024 as size_in_kb, p.usecounts, st.text from sys.dm_exec_cached_plans p cross apply sys.dm_exec_sql_text(p.plan_handle) st where p.objtype = 'proc' and st.dbid = db_id('database_name')--此处是数据库名称 order by p.usecounts desc
重新生成存储过程后清0