In SQL Server Code Named “Denali” CTP3, we introduced some enhancements in the way we handled keyboard shortcuts in SSMS. My colleague Prachi Bora, a PM in the SQL Server Manageability team, has a crisp blog write-up on what’s new and what makes this cool.
SSMS veterans out there can tell you in their sleep that Ctrl+E is the keyboard shortcut to have the T-SQL editor execute queries. The Visual Studio users on the other hand swear by the IDE and want a similar environment in SSMS and want to use Ctrl+Shift+E to execute their T-SQL scripts, just like they do in Visual Studio. The good news is that both set of users will be happy with the enhancements in keyboard shortcuts in Denali-SSMS.
You can choose between two settings that get installed with SSMS, you can import keyboard shortcut settings of your choice and, if you like, you can customize shortcuts further. In addition, you can save your settings and share them with your team. Here’s how:
Switching between Keyboard Settings
SSMS now comes with 2 keyboard settings:
1. SQL Server Denali Settings – for those who are already used to the keyboard shortcuts that came in SSMS in 2008 R2. These settings are also applied by default when you install Denali SSMS.
2. Visual Studio 2010 Compatible Settings – for those who want similar keyboard shortcuts in SSMS and database projects in Visual Studio 2010.
If you want to change from the SSMS Denali Settings to the Visual Studio 2010 Compatible Settings, go to “Tools” menu and choose “Import and Export Settings”. The following wizard screen will appear:
Choose “Reset all Settings” and click through the wizard. The wizard gives you the options to save your current settings or simply reset settings by overwriting. Choose the option you prefer and the following screen will appear where you can select the between the two settings that got installed with SSMS.
Choose the “Visual Studio 2010 Compatible Settings” and click “Finish”.
Your keyboard shortcuts will now be similar to Visual Studio and you can use, for e.g., Ctrl+Shift+E to execute queries.
Customize Keyboard Shortcuts and share with your team
SSMS in Denali uses the Visual Studio 2010 Isolated Shell. Amongst all the benefits that using the Visual Studio 2010 Shell brings, the ones I would like to highlight in this post are the abilities to customize keyboard shortcuts, determining the shortcut key assigned to a command and the ability to share your settings with your team. This article on MSDN walks through how to perform each of these actions in Visual Studio. Follow exactly the same steps using the Tools menu in SSMS and you should be good to go!
The ability to import and export settings also lets you share your keyboard settings file between SSMS, Visual Studio 2010 and SQL Server Developer Tools codenamed “Juneau”. If you use two or all of these products together and want same shortcuts in all cases, you can do so now.
One point to note is that there is currently no way to export any keyboard shortcut customizations you might have made in, for e.g., SSMS 2008 R2 and import them into SSMS in Denali. However, when you upgrade from 2008 R2 to Denali the manageability tools are installed side-by-side and you can continue to use both the versions of tools.
Assign shortcuts to frequently used stored procedures
If you have used SSMS in Denali CTP1, you may have noticed the absence of the ability to assign shortcuts to frequently used stored procedures. This feature was available in SSMS in 2008 R2 and went hiding in Denali CTP1, because of a bug. I am happy to tell you that the feature is now back in Denali CTP3 and you can use it as mentioned in this MSDN article, under the section “Creating a Keyboard Accelerator for a Stored Procedure”.
Update: Several users have reported problems with keyboard short-cuts not working quite right, when they uninstalled SQL Server Denali CTP1 and installed SQL Server Denali CTP3 on their machines. The way to work around the problem is to reset their settings (as shown above). Things should get back to normal after that.
Prachi Bora can be reached at email@example.com