Wednesday, July 13, 2011

Change the [Change Connection] shortcut in SSMS

I recently found this shortcut and it has been a lifesaver to manage multiple SQL servers in the [New Query] window

I can now paste/type the SQL statement first, ALT+G, enter new SQL name, F5 to execute

http://narfle.com/blog/2006/07/ssms-keyboard-shortcut-for-change.asp

1.Open a Query Editor window connected to your favorite server.
2.Right click on the Change Connection toolbar button on the Query Toolbar button and select the Customize command at the bottom of the menu.

3.Right click on Change Connection button again and then change the command name "C&hange Connection..." to "Chan&ge Connection...". This will change the hot key from Alt-H (which would conflict with the Help menu hot key) to Alt-G.

4.Finally, in the Right Click menu for the Change Connection button, you need to select the command option to display both "Image and Text". This exposes the Alt-G command to the Query Editor.

5.You can now close the Customize dialog and use Alt-G as your hot key!

3 comments:

  1. Thanks! works perfectly!

    ReplyDelete
  2. Open a query in SSMS. In the menu bar, select Tools -> Options -> Keyboard (Under the Environment node)

    Within the Press Shortcut Keys – Press the key you would like to assign to the shortcut to. In my case I have used F2. Within the commands box highlight Query.ChangeConnection and click on assign. This will now open up the SQL Server connection window on pressing F2.

    https://ashleybickerstaffe.wordpress.com/2016/05/04/change-sql-server-management-studio-ssms-connection-keyboard-shortcut/

    ReplyDelete