Using SSMS keyboard mappings in SSDT

We received a lot of feedback from our SSMS users that they wanted to continue using familiar SSMS keyboard mappings when using SQL Server Data Tools. We heard these requests and have produced a custom keyboard profile, the “SqlServerManagement.vssettings” profile, which is designed to satisfy that requirement. It is important to note that this set of keyboard mappings impacts many standard Visual Studio keyboard mappings, so if you are a heavy Visual Studio 2010 user, you should consider manually defining the key mappings you want rather than using this custom profile. Because of the impact this profile has over standard Visual Studio keyboard mappings we offer this profile as a web download as opposed to a shipped profile. It’s really meant to satisfy those traditional SSMS users who have developed strong muscle memory around their SSMS keyboard mappings.

NOTE: The default profile that ships with SQL Server Data Tools (SQL Server Development Settings) is a Visual Studio compatible profile, with keyboard mappings that do not conflict with standard Visual Studio profile key mappings, and only reflects two traditional SSMS key mappings. Use the shipped default profile if you DO NOT want your Visual Studio keyboard mappings overridden.

To illustrate the differences between the default “SQL Server Development Settings” and the downloadable custom “SSMS Keyboard Compatibility Settings” profile, the table below outlines the key mapping differences. If you are a Visual Studio user you should recognize where the conflicts might be an issue for you. As an SSMS user you should recognize many of the most used keyboard commands you’re familiar with.

Commands

SqlServerManagement.vssettings

SQL Server Development Settings

Execute

CTRL+E / ALT+X / CTRL+SHIFT+E

CTRL+SHIFT+E

Execute w/Debugger

ALT+F5

ALT+F5

Cancel Query Execution

ALT+BREAK

ALT+BREAK

Include Actual Execution Plan

CTRL+M

CTRL+D, A

Display Estimated Execution Plan

CTRL+L

CTRL+D, E

Results As Grid

CTRL+D

CTRL+D, G

Results As Text

CTRL+T

CTRL+D, T

Results As File

CTRL+SHIFT+F

CTRL+D, F

Show/Hide Results

CTRL+R

CTRL+D, R

New File

CTRL+N

None defined

Some commands were specifically not addressed because their impact to standard Visual Studio 2010 key mappings was too great. For example “Parse” in the standard SSMS context uses CTRL-F5, which turns out to be the Debug.StartWithoutDebugging (GLOBAL) key mapping in the Visual Studio context. Commands like this that are so integral to Visual Studio user context were not deemed good candidates for a profile that we should supply. However you are free to manually remap any keys you desire via the “Import and Export Settings” feature. Just know that doing so may make your Visual Studio 2010 environment behave badly or not as expected.

Downloading and Installing the SqlServerManagement.vssettings profile

If you decide you want the benefit of the SSMS key mappings, it’s easy to do. Simply download the SqlServerManagement.vssettings file to your Visual Studio development PC. Make a note of where you saved the vssettings file to as you will need to browse to that location later to import that settings file.

Once you have saved the SqlServerManagement.vssettings file locally to your PC, you can configure it as your Visual Studio profile by following these additional steps…

1. Launch your Visual Studio 10 environment from Start\All Programs\Microsoft Visual Studio 10.

2. Choose Tools\Import and Export Settings… from the main Visual Studio menus

clip_image002

3. Make sure “Import selected environment settings” radio button is selected, then click Next.

clip_image004

4. You can choose either “Yes, save my current settings” (recommended) or ”No, just import new settings, overwriting my current settings”. Click Next.

clip_image006

5. Browse to the location where you saved the downloaded SqlServerManagement.vssettings file and select it, then click Open.

clip_image008

6. In the “Which settings do you want to import? ” tree, expand the Settings\Options\Environment nodes and confirm that the Keyboard checkbox is selected.

clip_image010

7. Click Finish.

Now the SSMS Keyboard Compatibility key mappings have been configured for your Visual Studio 2010 environment. If you find that after this you have your own custom key mappings you’d like to add, you can continue to configure your profile manually. This article does not cover how to do that, but you can learn all you need on MSDN in the How to: Work with Keyboard Shortcuts article.

If you find you don’t like the custom profile key mappings, you can restore to your previously saved settings using the Import and Export Settings dialog again choosing your previous settings, or any other Visual Studio profile.

It is important to note that the SqlServerManagement.vssettings file is designed to work with Visual Studio 2010 or the SQL Server Data Tools standalone environments. It has not been tested against other versions of the Visual Studio environment, and may not work as expected outside the designed scope.

Let us know if this custom profile has been helpful. We’d love to hear your feedback.