Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Find plan_handle Expand / Collapse
Author
Message
Posted Thursday, January 10, 2013 7:57 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 5:51 AM
Points: 598, Visits: 1,615
Hi - If I know the executing query whats the best way to get the plan_handle such that I can look at the plan in the plan cache?

Thanks
Post #1405474
Posted Thursday, January 10, 2013 9:06 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 5:51 AM
Points: 598, Visits: 1,615
Have figured it out by using this query:

SELECT UseCounts, Cacheobjtype, Objtype, TEXT, query_plan, plan_handle
FROM sys.dm_exec_cached_plans
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
CROSS APPLY sys.dm_exec_query_plan(plan_handle)
WHERE TEXT like '%%'

Post #1405515
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse