0

I want to capture execution plan only for long running query (5 minutes) for this I have used extended event but the plan_handle which is returned by extended events does not produce an execution plan when I pass this plan_handle to sys.dm_exec_query_plan. But for the same statement I am getting execution plan when I use sys.dm_exec_query_stats.

Is it possible to get execution plan only for long running query using server side trace

My motto is to capture execution plan for long running queries & save this plan in target for later analysis. For this purpose I can't go with dmv's please

Dustin Laine
  • 37,935
  • 10
  • 86
  • 125
  • You can use [Extended Events with SQL 2012 or later](http://stackoverflow.com/questions/7359702/how-do-i-obtain-a-query-execution-plan/33657996#33657996) – Dave Mason Nov 12 '15 at 19:33

1 Answers1

0

This will be possible in the next version (SQL Server 2012). See related connect item.

Martin Smith
  • 438,706
  • 87
  • 741
  • 845