Posted By

PCurd on 04/01/10


query plans

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Return Cached Query Plans

 / Published in: SQL

  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  

You need to login to post a comment.