THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Denis Gobo

Increase Your Productivity With Query Analyzer/SQL Server Management Studio

Drag And Drop Column Names
In Query Analyzer you can save a lot of time by using this trick instead of typing all the column names of a table
Hit F8, this will open Object Browser
Navigate to DatabaseName/TableName/Columns
Click on the column folder and drag the column folder into the Code Window
Upon release you will see that all the column names are in the Code Window

Use Shortcuts
Did you know that you can have CTRL + Number key combinations/shortcuts in Query Analyzer? You can set it up so that CTRL + 5 executes sp_who2 for example. I thought everyone already knew this but apparently not; I showed this to 3 coworkers yesterday and they didn't know about it. So how do you set this up? It is pretty easy, select Tools -->Customize from the toolbar. In the Customize tab you will see 3 shortcuts already:

ALT + F1 sp_help

CTRL + 1 sp_who

CTRL + 2 sp_lock

To add your own queries/procedures type or paste the query or stored procedure that you want to execute into one of the empty ones (see picture below)

If you have 4 Query Analyzers applications open it will be available in all 4 of them. I usually have 4 Query Analyzer applications open, one for staging, one for development and one each for one of the production boxes. so if I have to quickly check that a table is the same on all 4 machines I just hit CTRL + 6 in all 4 Query Analyzer applications and I am done.

I created a Word document that looks like this
3 - errorlog
4 - product table
5 - country table
6 - vendor codes
7 - sp_who2
etc etc etc

The font-size is 32, I printed this out and put it next to my monitor so that I can quickly see which key combination I have to hit. Once you set this up you will see how much time it will save you. 

In SSMS 2005. Click Tools -> Customize -> "Commands" tab -> "Keyboard" button (Lower left corner of screen).On the options window, click the Keyboard option (under Environment). See pictures below:

Published Monday, September 24, 2007 12:52 PM by Denis Gobo



Mladen said:

this is just shameless advertising of free stuff :))

you might enjoy running custom scripts from the context menu...

September 25, 2007 10:02 AM

Michael Aaron Griffey said:

Drag And Drop Column Names

Why stop at just column names? You can drag and drop table names, stored procedure names, users, exc... This helps alot when you have a schema name like QuestionSeries with tables like Old_to_New_Question_Number and QuestionResponse. Stored procedures can get rather lengthy as well. (ex. ThatOneApplication_DoSomeStuffToTheTable)  

You can also use window’s program specific hotkey functions to program way more that 12 hotkeys for any program you have running. The keys behave differently depending on which application is  “Active”.

September 25, 2007 3:45 PM

PeterW said:

Don't forget Template Explorer in SSMS - Ctrl+Alt+T

September 26, 2007 6:15 AM

chenthorn said:

What do you do when drag/drop doesnt work? is there an option to check? All I get is a mouse pointer with a plus sign under it. I havnt found a key combo other than escape that does anything to drop the text on the my query window. thoughts?

October 15, 2007 11:57 AM

ellai said:

More shameless advertising... =D

If you are still using SSMS 2005 there's a new plugin available that is basically a solution explorer replacement and has common sense tasks like structuring queries, creating folders query sorting etc...

Give it a try <a href="" title="Management Studio 2005 project plugin">Management Studio 2005 project plugin</a>

June 29, 2010 7:40 PM
New Comments to this post are disabled

About Denis Gobo

I was born in Croatia in 1970, when I was one I moved to Amsterdam (and yes Ajax is THE team in Holland) and finally in 1993 I came to the US. I have lived in New York City for a bunch of years and currently live in Princeton, New Jersey with my wife and 3 kids. I work for Dow Jones as a Database architect in the indexes department, one drawback: since our data goes back all the way to May 1896 I cannot use smalldates ;-( I have been working with SQL server since version 6.5 and compared to all the other bloggers here I am a n00b. Some of you might know me from or even from some of the newsgroups where I go by the name Denis the SQL Menace If you are a Tek-Tips user then you might know me by the name SQLDenis, I am one of the guys answering SQL Questions in the SQL Programming forum.

This Blog


Privacy Statement