Quantcast
Channel: SQL Server Management Studio – Journey to SQL Authority with Pinal Dave
Viewing all articles
Browse latest Browse all 84

SQL SERVER – Save and Send Execution Plan Via Email

$
0
0

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.

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.

exec1 SQL SERVER   Save and Send Execution Plan Via Email

Step 2: Click on Execute Query

exec2 SQL SERVER   Save and Send Execution Plan Via Email

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

exec3 SQL SERVER   Save and Send Execution Plan Via Email

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…

exec4 SQL SERVER   Save and Send Execution Plan Via Email

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

exec5 SQL SERVER   Save and Send Execution Plan Via Email

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.

exec6 SQL SERVER   Save and Send Execution Plan Via Email

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

exec7 SQL SERVER   Save and Send Execution Plan Via Email

Reference : Pinal Dave (http://blog.SQLAuthority.com)


Filed under: PostADay, SQL, SQL Authority, SQL Performance, SQL Query, SQL Server, SQL Server Management Studio, SQL Tips and Tricks, T SQL

Viewing all articles
Browse latest Browse all 84

Trending Articles