x

SSMS Shortcut Keys

What is your favourite shortcut key for SSMS?

One shortcut per answer please

more ▼

asked Oct 15, 2009 at 09:03 AM in Default

avatar image

thatismatt ♦♦
210 8 12 12

Excellent question.

Nov 04, 2009 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, 2009 at 04:56 PM

avatar image

Steve Jones - Editor ♦♦
5.1k 79 93 87

(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, 2009 at 07:10 PM

avatar image

Raj More
1.8k 82 87 89

(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, 2009 at 09:24 AM

avatar image

David Atkinson
357 17 21 26

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

Ctrl + N - New Query

more ▼

answered Oct 15, 2009 at 09:11 AM

avatar image

thatismatt ♦♦
210 8 12 12

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

Ctrl + R to close the results window

more ▼

answered Oct 15, 2009 at 09:12 AM

avatar image

Jay Bonk
1.4k 2 4

(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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x152
x21
x5
x4
x1

asked: Oct 15, 2009 at 09:03 AM

Seen: 7127 times

Last Updated: Mar 12, 2012 at 12:26 AM

Copyright 2016 Redgate Software. Privacy Policy