How to View Multiple Queries and Results Side by Side in SQL Server Management Studio (SSMS) - SQL Server / TSQL Tutorial Part 14

Scenario:

You are working on multiple queries and seeing results. You want to see the queries and result windows at the same time in SQL Server Management Studio.How can you do that?

Solution:

This is really helpful feature of SQL Server Management Studio(SSMS), specially while debugging our scripts and comparing results. By default in SSMS, When you click on Query Window, only results related to that query window will show.

To see the Multiple queries and result windows, Go to Windows Drop down and choose Horizontal Tab Group or Vertical Tab Group.

We have selected Horizontal Tab Group, here is what we will see for our two queries and results after this setting.
How to see multiple Queries and Result Windows in SSMS - SQL Server Tutorial


How to see multiple queries and results in SSMS - SQL Server Tutorial




To see the queries and results in vertical , you need to go to Windows and select New Vertical Tab Group. Once you do that you will see the result as shown below.

How to see multiple queries and results in vertical position in SSMS - SQL Server Tutorial



To remove or to get to previous position. Go to Windows and then choose Go to Previous Position.
How to see multiple queries windows and result windows in SSMS - SQL Server Tutorial