Have you ever wanted to share a SQL Server execution plan with a colleague or friend, but didn’t know how to do it without sending them your entire database? In this article, we will explore a simple method to save and share execution plans in SQL Server.
Let’s say you have a large graphical execution plan that you want to send to someone. Here’s what you can do:
- Write your query in SQL Server Management Studio.
- Click on the icon on the top toolbar or use the shortcut CTRL+M to enable the actual management studio.
- Execute the query by clicking on the “Execute Query” button.
- Once the query has executed, the Execution Plan tab will appear. Click on it.
- Right-click on the execution plan and select “Save Execution Plan As…” from the menu.
- Save the file with the extension “.sqlplan”.
That’s it! You have now saved the execution plan as a file that can be shared with others. You can send the .sqlplan file via email or any other file sharing method.
If the size of the .sqlplan file exceeds the maximum file size limit of your email provider, you can try the following options:
- Compress the .sqlplan file using a file compression tool like WinZip or 7-Zip before sending it.
- Upload the .sqlplan file to a cloud storage service like Google Drive or Dropbox and share the download link with the recipient.
- If the recipient has access to SQL Server Management Studio, they can open the .sqlplan file directly and view the execution plan.
When the recipient opens the .sqlplan file in SQL Server Management Studio, they will be able to see the execution plan without needing to have the same database on their system. The .sqlplan file contains XML details for the plan, which can also be viewed by opening the file in a text editor like Notepad.
Now you can easily share SQL Server execution plans with your colleagues and friends, making it easier to collaborate and troubleshoot performance issues.