Friday, 11 June 2010

Assign shortcut key to "change connection" in SQL MMS

Fed up having to click the "Change Connection Icon" every time you want to change your connection in management studio, and wish there was a shortcut key you could press?  Then worry no more (and try get out more often)!

Right click anywhere on the tool bar, and select "Customize..." from the pop-up menu.

This will open up a "Customize" window - but IGNORE THIS!!

Instead, right click on the "Change Connection" icon (), and a customise menu will appear, specific to this icon.

To assign an ALT shortcut key combination to this icon you need to do 2 things:

1. change the position of the & in the "Name:" section - whichever letter the & is immediately before will become the shortcut key you use.
Note that some keys may already be assigned (e.g. ALT-H opens the Help menu, and C opens the Community menu) - but you could change those in the same way.

2. you must select the "Image and Text" option

Now hit close on the "Customize" window that I told you to ignore earlier, and give it a try.

In the example above, this has now set ALT-G to bring up the change connection window - which gives:

Job done - you can thank me later!


In SQL 2012, you can access this option via the Customize Menu.
Right click on the menu banner, and select "Customize"
Click on the "Commands" tab.
Click on the radio button next to "Toolbar", then scroll through the list to select "SQL Editor"

Now you can click on the "Change Connection" control, Once highlighted, click on "Modify Selection" over on the right, and set it to "Image and Text", and place the & symbol infront of whatever ALT-KEY you want.



Igal Shkolnik said...

Thanks, very helpful

Anonymous said...


Thank you :)

Chadwick said...

Thanks for the info! It is a little different in 2012:

1) Right-click/Customize/Commands
2) Choose Toolbar/SQL Editor
3) Then make the changes you described by highlighting the "Change Connection" item, then click "Modify Selection" on the right

Anonymous said...

Just what I needed !!!

Anonymous said...

Great stuff, thanks very much!

Nice for other commands like SQLCMD mode as well.

JEY said...

AMAZING!! I've been looking for this for AGES!

Grumpy DBA said...

Great update from Chadwick for SSMS 2012 - thanks.

You'll find on SSMS 2012 that you can't right click on the change connection button, as you have to get to it via the Toolbar / SQL Editor option, but it still works. :)

Anonymous said...

I love you and I want you to have my babies.

Anonymous said...

thanks, worked for me.

Post a Comment