My 2 Favorite SQL Server Management Studio Tricks

by brad 12. November 2007 14:06

My favorite SQL Server Management Studio trick is assigning USE statements to keyboard shortcuts so I don't have to manually change databases by using the drop-down in the SQL Editor toolbar.

Under Options, Environment, you'll find a Keyboard section that allows you to bind a SQL statement to a keyboard shorcut.  Pick your favorite databases, assign "USE MyDatabase" to a keyboard shortcut, and you'll never have to use that drop-down again.

Management Studio Keyboard Options

This is great, because you can go from desktop to query without every touching your mouse.

1. Launch Management Studio using your favorite application launcher (or by typing "SqlWB" at the Run promt)
2. Type in the name of the server and hit [Enter]
3. [CTRL + N] to open a new query window
4. [CTRL + 3] to execute "USE MyDatabase"
5. Type your query
6. Hit [F5]

My second favorite SQL Server Manage Studio trick is turning on column header copying so my column headers are included when I copy/paste from Management Studio to Excel.

This one is under Options, Query Results, SQL Server, Results to Grid. The goodie you want is "Include column headers when copying or saving the results". 

Management Studio Copy to Excel

If you're not using Results to Grid, then you can switch back and forth between grid and text by using the [CTRL + D] and [CTRL + T] keyboard shortcuts.

Tags:

Comments are closed

About Brad

Brad Tutterow lives in Illinois and works in Missouri. He has 12 years of experience developing web sites and Windows applications using a variety of technologies and is most excited currently about Silverlight, Windows Phone 7, Halo Reach, and Visual Studio 2010.