1 SELECT st.text as sql_statement, 2 qs.creation_time as plan_last_compiled, 3 qs.last_execution_time as plan_last_executed, 4 qs.execution_count as plan_executed_count, 5 qp.query_plan 6 FROM sys.dm_exec_query_stats qs 7 CROSS APPLY sys.dm_exec_sql_text(qs.plan_handle) st 8 CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) qp 9 order by plan_last_compiled desc