Return Cached Query Plans


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT usecounts,cacheobjtype,objtype,query.text,executionplan.query_plan FROM sys.dm_exec_cached_plans OUTER apply sys.dm_exec_sql_text(plan_handle) AS query OUTER apply sys.dm_exec_query_plan(plan_handle) AS executionplan WHERE text NOT LIKE '%sys%'AND cacheobjtype ='compiled plan'

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.