Posts Tagged ‘SQL SERVER – Discard result after query execution’

Today, I was optimizing few queries but due to the large number of records it was taking a while to display the result set and the execution plan and I was interested to view the execution plan instead of the result set to optimize it. But if you need the execution plan you need to wait for the result set to finish and then execution plan will be displayed.

So, I was searching for some options that could give me execution plan instead of result set only.

Finally, I found it. It is available in SSMS \ Tools \ Options \ Query Results \ Result to Grid \ Discard result after execution

By default, this option will be unchecked but to discard result set, you need to check it.

Lets go through step by step :

Step 1 :
Open the SSMS then go to Tools \ Options \ Query Results \ Result to Grid \ Discard Result after execution. You need to check it and press OK.

Step 2 :
Once you press OK, it will alert you, with “SQL Server Results to Grid option changes will only be applied to new SQL Server Query Editor windows”

Step 3 :
Open a new query window and execute the query. Now this time you will get the execution plan only.

Remember to include the execution plan otherwise it will display no execution plan.

Result set

Execution Plan

Read Full Post »