Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSMS Display Separate Queries In Separate Results Tab

In SQL Server Management Studio, if I run a query like

SELECT TOP 1000 *
  FROM SomeDB

SELECT TOP 1000 *
  FROM SomeOtherDB

The results display in one tab but split horizontally down the middle, is there any way to get the results of multiple queries to display in multiple tabs?

like image 432
Smudge Avatar asked Jul 22 '11 09:07

Smudge


People also ask

How can I see multiple query results in SQL?

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.

How do I view query results in SQL Server Management Studio?

In SQL Server Management Studio, under Tools menu, click Options as shown in the snippet below. 2. In the Options dialog box, expand Query Results, expand SQL Server and then select General as shown in the snippet below.

How do I separate SQL queries?

Semicolon is the standard way to separate each SQL statement in database systems that allow more than one SQL statement to be executed in the same call to the server. In this tutorial, we will use semicolon at the end of each SQL statement.

How do I display the results in SQL Server?

You have the option of displaying your query results on the Run SQL window, as opposed to Data Display windows. To do this, go to View > Data Grid (Ctrl+G). Once you have selected this option, a panel will appear at the bottom of the window - your query results will be displayed there.


1 Answers

Tools -> Options -> Query Results -> Results To Grid -> Display Results in Separate Tab

This will show the results in a separate tab (though all result sets will be in that one tab).

As far as I know, there is no way to separate out the different result sets as you seem to want, apart from having separate query windows.

like image 110
Oded Avatar answered Oct 15 '22 02:10

Oded