Chapter 19. Extending your productivity in SSMS and Query Analyzer

 

Pawel Potasinski

Many SQL Server developers and administrators prefer to use T-SQL code instead of a graphical interface to perform their common duties. I’m definitely one of those T-SQL maniacs. That’s why the ability to define custom keyboard shortcuts in SQL Server Management Studio (SSMS) in Microsoft SQL Server 2005 and 2008, and SQL Server Query Analyzer in Microsoft SQL Server 2000, is one of my favorite features of those applications. I love the idea that during the development of my database, which contains more than 100,000 objects at the moment, I can use my utils to easily perform everyday tasks such as searching for a specific object, showing the object definition, or finding dependencies between database objects. If you spend some time on writing your own utils to fit your needs, I can promise you won’t regret it.

Custom keyboard shortcuts

Both Query Analyzer and SSMS provide the ability to call T-SQL code with custom keyboard shortcuts. You can define the shortcuts using the main menus of those applications (note that the way you define the shortcuts in both applications is slightly different).

To define custom shortcuts in Query Analyzer:

  1. On the Tools menu, click Customize... (see figure 1).
    • In the Customize window (shown in figure 2), add your T-SQL code next to the chosen keyboard shortcut and click OK.
Figure 2. Keyboard shortcuts defined in the Customize window in Query Analyzer

Creating your custom utility to use with keyboard shortcuts

Some ideas for utilities to implement

Summary

About the author