MSSQLWIKI

Karthick P.K on SQL Server

Posts Tagged ‘all queries and cached plans’

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')

Posted in SQL Query | Tagged: , | 1 Comment »

 
%d bloggers like this: