/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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'