Search code examples
sql-serverssmskeyboard-shortcuts

SSMS shortcut to navigate between open query windows


I sometimes have a large amount of query windows open in SSMS 2008.

Is there a keyboard shortcut to navigate between open query windows? Go to previous/next open query window?

I know there is Ctrl+Tab that allows you to select a query window, but it's only helpful if you have named windows.


Solution

  • A challenge you'll find here is what does "next" really mean? Since you can tear off tabs, split the UI, even move tabs onto different monitors, I think "next" and "previous" lose a little meaning, unless you know what order they were opened in.

    Anyway, some solutions, with older versions (based on when the question was asked) left intact:

    SSMS 2008

    Ctrl+F6 will switch between two most recent tabs. And honestly, Ctrl+Tab / Ctrl+Shift+Tab work like next/previous except you have to hit Tab twice (you can ignore knowing what the name of the tab in the list is).

    SSMS 2012

    • Ctrl+F6 will cycle through open tabs in the order they are displayed, and Ctrl+Shift+F6 will cycle in the reverse direction.
    • Ctrl+Tab / Ctrl+Shift+Tab will open a temporary window and allow you to cycle through open queries in the order they were last opened.

    In more recent decades

    • Ctrl+Alt+[Page Up|Page Down] will cycle through windows (as bridge_burner added), but there's a catch. This only works when the query window is active - and it will stop working if you get to a query window where, previously, you had an item in the grid selected, for example.
    • You can make your own keyboard shortcut, as Stuart Smith explains.