I have SQL Server 2008 and SSMS 2008, and I’m debugging a script. I can step through the script with no problems at all, but if I click the toolbar button for “Include Actual Execution Plan” (the one that adds an additional results tab with the execution plan), I’m not able to debug anymore.
Instead, when I click debug, debugging starts and immediately stops again, and the results pane says my thread successfully exited.
Should I submit this as a bug, or do debugging and execution plan viewing inherently not go hand-in-hand (though I’m not sure why they wouldn’t)?
You could use SQL Server Profiler to return the actual execution plans. Using Profiler you will be able to see the execution plans without interfering with debugging. An example would be:
You may add any other events and columns you want to the trace, and you may filter the trace appropriately – for example you may start debugging, then filter the trace to just the SPID that you are debugging.
As you step through (or even just run) your script, all the execution plans will appear in Profiler.