Script to get all the Query and cached plans
Posted by Karthick P.K on February 18, 2009
SELECT
*
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) eqp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) est
--WHERE est.dbid = DB_ID('DBNMAE')
Top SQL Server blogs from MSSQLWIKI « MSSQLWIKI said
[…] Script to get all the Query and cached plans […]