Opening an actual plan in a separate SSMS tab

I generally find it irritating to try and scroll through a multi-query batch/stored procedure to look at a single execution plan because the scroll bar in a scroll bar is not a great experience.  If you have a batch you are running that has some iterative logic it will generate a lot of plans and the SSMS UI kind of gives up.  I found a way around this which allows you to click on the one plan you are interested in and open the plan in its own tab.

As an alternative to quickly see all the different plans involved and let you click on the plan so it opens in a new tab, you can use SHOW STATISTICS XML ON.  In order for it to show the plans this way it is important you turn off “Display Actual Plan”.

At the top of the query you can see we added SET STATISTICS XML ON.  In the results tab, under the output of the query (or event if there is not output) you will see a link to the execution plan.  If you click on this link it will open only that plan in a new SSMS tab.

This is a quick and easy way to view output from SSMS where you have a large stored procedure with many individual queries.

Happy tuning!

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *