Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

find plan handle of query already executed Expand / Collapse
Posted Wednesday, April 3, 2013 11:34 AM


Group: General Forum Members
Last Login: Friday, November 18, 2016 9:50 AM
Points: 1,525, Visits: 3,573

I am trying to find actual execution plan of a adhoc query. SO i want to find the plan handle so that i can pass through sys.dm_exec_query_plan to get the actual execution plan. Any way to find the plan handle of a given adhoc query?
Post #1438509
Posted Wednesday, April 3, 2013 12:30 PM



Group: General Forum Members
Last Login: Today @ 5:18 AM
Points: 45,619, Visits: 44,147
Query sys.dm_exec_cached_plans, cross apply to sys.dm_exec_sql_text and search for the text matching the ad-hoc query.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1438531
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse