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 of query already executed Expand / Collapse
Author
Message
Posted Wednesday, April 3, 2013 11:34 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, October 19, 2014 8:33 PM
Points: 1,285, Visits: 2,963

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


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:46 PM
Points: 40,204, Visits: 36,604
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 2008, MVP
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