SQL SERVER – View XML Query Plans in SSMS as Graphical Execution Plan

Earlier I wrote a blog post on SQL SERVER – Parallelism – Row per Processor – Row per Thread, where I mentioned the XML Plan. As a follow up on the blog post, I received the request to send the same execution plan so that the blog readers can also use the same and reproduce it on their machine. I realized that I have actually never written on how one can send a graphical execution plan to another user so that they can reproduce the same exact details without all the actual tables, indexes and objects.

Here is very simple method on how one can do that.

Right Click on Execution Plan and click on “Save Execution Plan As…”.

You can save the plan with the extension .sqlplan. The same plan can be sent to another user via email or a USB drive. Another user can just double click on the file and open the execution plan at another local computer without physically having any underlying object.

This is very simple trick; you can also send the execution plan in text format as well. We will talk about it in some other post.

Has anyone found a good way to be able to export to one big pdf file or image file? Sometimes it is hard to see the full plan on a complicated or multi step query and it would be better to be able to view it full screen.

@Pinal: Actually, another way to send a few execution plans to another person is to save a trace file, which contains the execution plans. Also, in Management Studio you can click on “Show execution plan XML…” and copy-paste it into an email.

This is a great tip Pinal and I’m frequently surprised by just how often it gets overlooked by people.

It’s especially useful in larger organisations were the roles of Developer and Database Administrator are split. This feature gives the DBA the ability to send details of an execution plan (proof perhaps of a poorly performing query for example) to the development teams for their review.

Pinal Dave is a SQL Server Performance Tuning Expert and an independent consultant. He has authored 11 SQL Server database books, 21 Pluralsight courses and has written over 4000 articles on the database technology on his blog at a https://blog.sqlauthority.com. Along with 16+ years of hands on experience he holds a Masters of Science degree and a number of database certifications.