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.

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

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

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

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

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.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Execution Plan, SQL Scripts, SQL Server Management Studio, SQL XML
Previous Post
SQL SERVER – Parallelism – Row per Processor – Row per Thread
Next Post
SQL SERVER – Index Levels, Page Count, Record Count and DMV – sys.dm_db_index_physical_stats

Related Posts

8 Comments. Leave new

  • 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.

    Reply
  • @Jason: well, sometimes I apply the mighty Ctrl+PrtScn when I need to show the execution plan to the business executives in a presentation.

    Reply
  • @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.

    Reply
  • 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.

    Great post!

    Reply
  • When I update my table will my view will get affected that is connected to the table .

    Reply
  • explain me the techniques to reduce the parllelisam

    Reply
  • What do you do when the xml never renders to a graphical representation? I have a 2000 line xml file that won’t render.

    Reply
  • what how to save execution plan in sql server 2000 version???
    There we don’t have option “Save execution Plan as”…. it is grayed in 2000 version.

    Reply

Leave a Reply