SQL Server Management Studio: Displaying Multiple Code Windows

By Don Kiely | December 06, 2012


You have several options for viewing and manipulating multiple code windows.

When you have two or more queries open, you can right-click the title bar of the Query Editor and choose either New Horizontal Tab Group (see the Figure below) or New Vertical Tab Group. The same options are available from the main Window menu in Management Studio.

If you select a new horizontal tab group, you'll see something like the Figure below. Note that each window still can maintain an independent connection to an instance of SQL Server; you can see this information in the status bar at the bottom of each query editor window. Each of the tab groups you create can contain multiple query editor windows.

The Query Editor in a horizontal tab group

To move the active window to another tab group, choose Window|Move to Next Tab Group or right-click the title bar and choose Move to Next Tab Group. The option in either case might be Move to Previous Tab Group if a window in the second tab group is active. Or, you can simply drag the window to another group.

There are three ways to un-split the window:

  • If the window you move is the last one in a tab group, the empty tab group will automatically close.
  • Close all of the query editor windows in a tab group.
  • Drag all of the query editor windows from a tab group to another tab group.

TIP: To maximize the Query Editor window, press SHIFT+ALT+ENTER. Press it again to switch back to Normal view. This keyboard shortcut works with any document window.

If you select the Window|Close All Documents option from the main menu, all documents and all tab groups will close. You'll be prompted to save any files in windows with unsaved changes. Management Studio has your back!

This post is an excerpt from the online courseware for our SQL Server 2012: Configuring Management Studio course written by expert Don Kiely.

Don Kiely

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.

This blog entry was originally posted December 06, 2012 by Don Kiely