Improvement to Keyboard Shortcuts in SQL Server 2012 Management Studio


By:   |   Updated: 2012-02-27   |   Comments (5)   |   Related: More > SQL Server Management Studio

Problem

A new feature in SQL Server 2012, is the ability to reset keyboard shortcuts in SQL Server Management Studio to match Visual Studio 2010. In this tip we will take a look at how easily you can change keyboard shortcuts in SQL Server Management Studio using the Import and Export Settings Wizard.

Solution

Database Developers and Administrators who are used to using SQL Server Management Studio know that to execute a Query within the TSQL Editor you can use the CTRL+E or F5 keyboard shortcut keys. However, users who use Visual Studio 2010 are used to the CRTL+SHIFT+E keyboard shortcut to execute a query using the Visual Studio IDE. The best thing is that both sets of users can now be happy as SQL Server Management Studio in SQL Server 2012 comes with 2 different types of keyboard shortcut settings as mentioned below.

  • SQL Server 2008 R2 Compatible Settings: - This setting can be used by users who are already familiar with keyboard shortcuts that were available in SQL Server Management Studio for SQL Server 2008 R2. These settings are applied by default once you install SQL Server Management Studio for SQL Server 2012.
  • Visual Studio Compatible Settings: - This setting can be used by users who want similar keyboard shortcuts in SQL Server Management Studio as are available in Visual Studio 2010.

Let's go through the steps to use the Import and Export Settings Wizard in SQL Server Management Studio for SQL Server 2012 to change the default keyboard shortcut settings to what is available in Visual Studio 2010.

1. In SQL Server Management Studio for SQL Server 2012 from the Tools menu select the Import and Export Settings... option from the drop down list as shown in the snippet below to open up the Import and Export Settings Wizard.


SSMS import and export settings feature

2. In the Welcome to the Import and Export Settings wizard screen you will be able to see three different options:

  1. Export selected environment settings: - use this option to save currently used setting to a file so that it can be imported any time to another machine.
  2. Import selected environment settings: - use this option to import settings from a file so that you can apply the same in the current environment.
  3. Reset all settings: - If you want to swap the keyboard shortcut keys to that of SQL Server 2008 R2 Compatible Settings or Visual Studio 2010 Compatible Settings then choose this option.
ssms import export reset all keyboard settings

3. In the Import and Export Settings wizard screen once you select the Reset all settings option then click the Next button to continue with the wizard.

4. In the Save Current Settings wizard screen you will see an option to either Yes, save current settings or No, just reset settings, overwriting my current settings. If you have added any Query shortcuts then it is recommended to save your current settings to a file for future use. Click Next to continue with the wizard.

save current keyboard settings for sql server

5. In the Choose a Default Collection of Settings wizard screen you will find options to configure environment settings to closely match SQL Server 2008 R2 or configure the environment settings to closely match Visual Studio 2010. Choose the approrpiate option and click Finish which makes the settings take effect immediately.

ssms choose default collection for keyboard settings
Next Steps


Last Updated: 2012-02-27


get scripts

next tip button



About the author
MSSQLTips author Ashish Kumar Mehta Ashish Kumar Mehta has been contributing to the MSSQLTips.com community since 2009 with over 60 tips.

View all my tips
Related Resources





Comments For This Article




Saturday, August 15, 2015 - 4:40:57 PM - Kenny Back To Top (38452)
Hi Ashish. Thanx a ton for this. It seems such a silly thing to be grateful for but CTRL+R is a heck of a lot quicker than CTRL+SHIFT+ALT+R to toggle the results pane display. Not to mention the strain on the wrist and fingers (LOL). This is the first time that a solution has actually helped me. Keep up the great work.

Tuesday, July 23, 2013 - 12:18:28 PM - Vijay Kanaparthy Back To Top (25965)

Alt+D selects the database combo box. Use letter/arrow keys to make your selection


Monday, April 23, 2012 - 7:13:36 AM - Dave Back To Top (17053)

Hi, there is a possibility to collapse or expand all the code in the window?

In visual studio was ctrl M + ctrl O


Tuesday, February 28, 2012 - 12:47:39 AM - Rajendra prasad Back To Top (16180)

Hi, ameena

 use CTRL U, to select database and Give the first letter of the DB name ,and Give enter.

 


Monday, February 27, 2012 - 10:47:45 AM - Ameena Back To Top (16172)

Hi,

Do you know a short cut in object explorer to open the database engine from the connect drop down menu?

thanks

Ameena



download


Recommended Reading

Display Line Numbers in a SQL Server Management Studio Query Window

SQL Server Management Studio Connection to Integration Services Error Class Not Registered

Connect to SQL Servers in another domain using Windows Authentication

Executing large scripts in SQL Server Management Studio with Insufficient Memory Failures

How to use RunAs command for SSMS if option does not exist





get free sql tips
agree to terms


Learn more about SQL Server tools