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: Wednesday, October 5, 2016 2:34 PM
Points: 1,517, Visits: 3,557

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 @ 3:22 PM
Points: 45,441, Visits: 43,796
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