ShotCut Key

  • Hi,

    Please advise if I can have a shortcut key for changing connection of SQL Server using the key board, rather than changing the connection manually.

    I need to constantly change connections to run queries on Production servers.

  • If you have the button to call the context menu (like when you right-click with the mouse), it is possible:

    1. Hit the context menu button

    2. Hit c

    3. Hit h

    4. Change the connection. This only changes the connection for the current query.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • If you're running the same query over different production servers, like when running a check on all production servers for example, there's a feature in SSMS that might make your life easier. You can run a query against multiple servers at the same time.

    In Registered Servers, create a new Server Group. Then add your SQL Servers to it. You can create multiple groups and create as many servers in each one as you need to. You can also have one server in more than one group. Think of it as a folder structure. In your case, you could have a group with all production servers and another group with a group of servers you commonly run the same commands against.

    Then, right-click the name of the group and click New Query in the context menu. A new SQL tab will open that's connected to all the servers. When you run your query in this window, it'll run against all the servers. Any result sets returned will each contain the name of the server that's returning the rows. The only real caveat here is that if you're querying data from all servers at once, the return result sets must match as they come back from all the servers.

    HTH

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply