x
login about faq Site discussion (meta-askssc)

SSMS Shortcut Keys

What is your favourite shortcut key for SSMS?

One shortcut per answer please

more ▼

asked Oct 15 '09 at 09:03 AM in Default

thatismatt gravatar image

thatismatt ♦♦
210 7 8 9

Excellent question.

Nov 04 '09 at 09:31 AM John Sansom
(comments are locked)
10|1200 characters needed characters left

24 answers: sort voted first

ALT+X to execute batches, but I am trying to move to CTRL+E

However CTRL+K, CTRL+U or CTRL+K, CTRL+C for commenting/uncommenting are way up there for me as well.

more ▼

answered Oct 15 '09 at 04:56 PM

Steve Jones - Editor gravatar image

Steve Jones - Editor ♦♦
5.1k 74 78 82

(comments are locked)
10|1200 characters needed characters left

If you go to Tools/Options/Environment/Keyboard you can associate your own stored procedures to shortcut combinations. For example if you often need to select the top five rows of a table, add this to master and associate a keyboard combination in the options with the stored procedure. You'll have to open a new query window for the changes to take effect. The cool thing here is that any selected text is passed in as a parameter to the associated stored procedure.

CREATE PROCEDURE sp_select_top5 @table varchar(8000) 
AS BEGIN 
 declare @dynamicSQL varchar(8000) 
 set @dynamicSQL = 'select top 5 * from ' + @table 
 exec(@dynamicSQL);  
END
more ▼

answered Oct 27 '09 at 09:24 AM

David Atkinson gravatar image

David Atkinson
317 8 11 21

I love these user-defined shortcuts. You can actually just use "SELECT TOP 5 * FROM " and skip the stored procedure and dynamically generated SQL (See the out of the box query for Ctrl+5)

Nov 04 '09 at 11:04 AM KenJ

Nice. Seems obvious now that you mention it! :)

Nov 12 '09 at 03:09 AM David Atkinson
(comments are locked)
10|1200 characters needed characters left

Save Save Save (even if there's auto-save ON, please save)

CONTROL S

more ▼

answered Oct 17 '09 at 07:10 PM

Raj More gravatar image

Raj More
1.7k 74 78 82

I can't mod this up enough! I remember doing some development using Crystal Reports. It was even more the case that you needed to save all the time with that software! I think we basically got RSI from saving so frequently.

Oct 19 '09 at 08:57 AM Melvyn Harbour 1 ♦♦
(comments are locked)
10|1200 characters needed characters left

My favorite is SHIFT + ALT + Arrows. Its not Shortcut, but I liked it a lot !!!

alt text

more ▼

answered Nov 04 '09 at 08:39 AM

Laerte Junior gravatar image

Laerte Junior
488 2

(comments are locked)
10|1200 characters needed characters left

Ctrl + N - New Query

more ▼

answered Oct 15 '09 at 09:11 AM

thatismatt gravatar image

thatismatt ♦♦
210 7 8 9

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x118
x21
x3
x3
x1

asked: Oct 15 '09 at 09:03 AM

Seen: 4156 times

Last Updated: Mar 12 '12 at 12:26 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.