SQL SERVER – Save and Send Execution Plan Via Email

Here is an interesting question, I received the other day.

Hi Pinal,

I have a very big graphical execution plan and I want to send it to my friend. My first thought was to send him query to execute on his own machine, but he does not have the same database which I am using. I also do not want to send my large database to him.

How can I save the execution plan to my computer and send it to him via email? Additionally, my email support only maximum of 20 MB, so please also guide me, what should I do if the size goes over 20 MB?

Thanks!

It is indeed a very interesting question. Here is the simplest way to do what the user is asking in the email.

Solarwinds

Here is a quick tutorial.

Step 1: You can write any query and click on the icon on the top tool bar or type shortcut CTRL+M to enable actual management studio.

SQL SERVER - Save and Send Execution Plan Via Email exec1

Step 2: Click on Execute Query

SQL SERVER - Save and Send Execution Plan Via Email exec2

Step 3: It will execute the query and will bring up Execution Plan Tab. Click on the Execution Plan Tab.

SQL SERVER - Save and Send Execution Plan Via Email exec3

Step 4: Upon clicking on Execution Plan it will bring up a query execution plan. Right Click over here and it will bring up a menu. In this menu click on the Save Execution Plan As…

SQL SERVER - Save and Send Execution Plan Via Email exec4

Step 5: You can save your file with the extension.sqlplan.

SQL SERVER - Save and Send Execution Plan Via Email exec5

That’s it! You are done. Now you can send the sqlplan via email to anyone. When someone opens the file, it will open in SQL Server Management Studio as displayed in the following image. The user has no need to have any database on their system. They can just see the data fine in the sqlplan.

SQL SERVER - Save and Send Execution Plan Via Email exec6

You can open the sqlplan file in the notepad and you will see xml details for the plan.

SQL SERVER - Save and Send Execution Plan Via Email exec7

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

Solarwinds
Previous Post
Interview Question of the Week #044 – What is the difference of performance between SELECT and SET?
Next Post
SQL SERVER – Understanding SQL Server Setup Support Rules for Cluster Nodes

Related Posts

1 Comment. Leave new

Leave a Reply

Menu