THE SQL Server Blog Spot on the Web

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

Andrew Kelly

Seldom Used Keyboard Tricks


I was giving an internal talk on SSMS productivity trips and there were a few that I believe are seldom used but can be a real time or keystroke saver that I would like to mention. To the best of my knowledge these will work in any version of SSMS from at least 14.0 onward and likely earlier but I can’t verify older versions at this time. Since these are basically Visual Studio shortcuts they also work in Visual Studio and SSDT to the best of my knowledge. The first is the ability to select text in a vertical fashion as shown in the examples below. Before we get to how to do that I know your first question is why would you want to do that. Well I will leave all the possibilities up to you since everyone has slightly different techniques and circumstances. However I am confident that after seeing a few examples it will spark interest in many of you and you will immediately think of times when this will help you code more efficiently.

OK now on to the HOW to do this. That part is really pretty simple and there are two ways that I know of off hand. BTW, I am sure that after playing with this for just a few minutes you will have figured it all out anyway but I will post some instructions and examples just the same. The first way is to position your mouse cursor on the line at the point in which you want to start. Then you can use your keyboard and press SHIFT – ALT and then use the arrow keys as you see fit. Or you can press only the ALT key and move your mouse in the direction you wish to highlight or operate on. Both techniques mentioned will give you the same results. I find the mouse method a little easier overall but YMMV. I will use the block of code shown directly below as the basis for most of the subsequent examples.


Keep in mind that there are 2 types of processes or operations that you might use this for. The first is typically used when you want to insert something into existing code at a certain spot but across multiple lines at once. The example directly below shows what that would look like when selecting the rows at a specific position or insertion point. If I placed my cursor just in front of the number 1 in the first row and then pressed SHIFT – ALT – Down Arrow 7 times I would get a thin (in this case blue) line like the one with the arrow pointing to it. More on this technique shortly.



However if I needed to use the second type of operation I would take that one step further and move my cursor / mouse left or right to highlight one or more characters in each row as shown below.


Once I have highlighted a set of rows / columns I can then replace that highlighted text with new text of my choosing in a number of ways. If I had something in my clipboard I can do a paste and all of the highlighted sections in each row will be replaced with the clip board contents.  OK I hear someone saying well you could have just done a search and replace. Well sure but if you look closely you will see each character that I had highlighted in the vertical column was a different value in each row. I would have had to do 8 different search and replaces instead of just one using this method. Or I can simply start typing and you will see the original text is instantly replaced with what ever I type as shown in the partially completed replacement below.


Another great benefit of this technique is that you can be selective in which blocks of code you want the text replaced or acted upon. For instance I want to operate on only 4 of the 8 lines of code. If I did a search and replace I would have to do this one line at a time and choose which line I wanted to act upon and which I wanted left alone.


Here I selected the middle 4 lines and upper cased the word select. How did I do that? Well this technique also works with standard keyboard short cut’s such as Ctrl- Shift-U which will upper case what ever is highlighted as I did below.  I am sure you can begin to see the possibilities of this technique.



In this example shown below I use the other technique mentioned earlier to position the cursor at a certain place vertically across what ever rows I need.


I often have to terminate a number of rogue processes at the spur of the moment and this technique comes in very handy for that. I can identify the session_id’s using something like sp_whoisactive but when there are multiple sessions it can get tedious and error prone to manually type the “KILL nnn” commands for each one. Now I can simply copy the list of session_id’s and paste them into a query window and set the insertion point directly in front of all the session_id’s at once. Now I simply type “KILL “ and it instantly fills this in at the correct spot before all the lines at once. Again this is impossible to do with search and replace as each row is different text. Now all I had to do is execute the batch and smile as I rest assured the SQL Server instance is once more safe from these rogue processesSmile.  Obviously you will find more uses for this based on your own environment but I think you get the idea.


And finally I wanted to point out that if you are using the pure keyboard method don’t forget to use the SHIFT along with the ALT. If you simply press just the ALT key plus an up or down arrow you will shift the line the cursor is on up or down one line for each arrow press. The example below shows what happens if the cursor was anywhere on line 3 and the ALT and up arrow key was pressed. While that tip can certainly come in handy as well it may not do what you expect. If you use the ALT and Mouse method this will not happen.



I realize this was a long winded set of examples but I had fun outlining them. This is a very under utilized set of features that is built into some of your most important daily tools so remember to take advantage of them. I have also include a few links to some more extensive lists of short cuts for SSMS that you should find useful.

BOL SSMS Keyboard Shortcuts

Andy Mallon’s SSMS Keyboard Shortcuts

Red-Gate SSMS Keyboard Shortcuts




Published Thursday, June 22, 2017 10:48 AM by Andrew Kelly

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



zhang said:    chrome store    Nike Jordans    michael kors australia    yeezy boost 350 shoes    coach factory outlet    louis vuitton us    michael kors australia    snow boots uk    pandora ring    michael kors    kate spade handbags    Air Max 90 Femme    pandora uk    business blog    ray ban sunglasses    official coach outlet site    kate spade canada    myhermes parcel shop    pandora charms    Nike Schuhe Damen    Wave Prophecy 2 Shoes    puma shoes    louboutin shoes    sunglasses hut    Nike Air Max 2017    gel kayano    fun games for kids    chanel outlet    birkenstock outlet    cheap ray ban    michael kors outlet    Obat Kuat Sex    puma oulet sale    kate spade    coach factory outlet online    clb shoes sale    north face outlet    Jared Jewelry - Official    Nike Free    kate spade outlet    ray ban frames    michael kors    kate spade outlet    coach factory outlet    kate spade outlet    China wholesale    ray ban sunglasses    oakley outlet    coach outlet online    kate spade new york store    ray ban uk    chanel outlet    jimmy choo outlet    birkenstock canada    payless shoes    pandora australia    black friday deals online    ray ban sunglasses    Prada Shoes - Official    fulam shoes    articles    pandora rings uk    burberry outlet    pandora uk    ugg boots    tory burch outlet    jimmy choo heels    louis vuitton outlet    nbastore    timberland boots    school bags online    nike huarache shoes    Louis Vuitton Outlet    omega watches    clearance    Prada Sunglasses - Official    michael kors outlet    nike outlet    Kay Jewelers - Official    ray ban justin    Air Jordan Homme    Dreamland Jewelry - Official    burberry outlet sale    pandora necklace    Nike Air Max 90 Mes    Nike Blazer Femmes    nike outlet    puma shoes    Online Oyun    timberland boots    michael kors uk    michael kors uk    Nike Boots    Engagement Rings - Official    Wholesale womens autumn winter clothing    under armour outlet    mulberry outlet    coach handbags sale    black friday deals    yeezy boost 350    louis vuitton    Kaufen Nike Air Max 1    Air Max 1 Homme    michael kors australia    pandora jewelry sale    michael kors australia official    Louis Vuitton Online    michael kors australia    ray-ban glasses    soccer store    pandora outlet    hermes outlet    The Retail Compliance Association    Nike Free Run    Nike Schuhe Herren    tory burch outlet    Louis Vuitton Outlet    ray ban wayfarer sunglasses    michael kors    official louis vuitton    ray ban shop    Nike Air Max 180    Prada Shoes - Official    mulberry outlet    burberry outlet coupon


January 9, 2018 9:25 PM

lzmee said:    official coach outlet site    clearance    business blog    under armour outlet    Nike Schuhe Damen    pandora charms    nike huarache shoes    pandora australia    michael kors outlet    michael kors australia    louboutin shoes    burberry outlet coupon    Nike Air Max 180    ugg boots    Wholesale womens autumn winter clothing    kate spade handbags    snow boots uk    The Retail Compliance Association    Wave Prophecy 2 Shoes    jimmy choo outlet    chrome store    cheap ray ban    tory burch outlet    chanel outlet    pandora jewelry sale    tory burch outlet    Nike Boots    Nike Jordans    puma shoes    yeezy boost 350 shoes    burberry outlet    school bags online    pandora uk    kate spade new york store    louis vuitton outlet    timberland boots    yeezy boost 350    nike outlet    Louis Vuitton Outlet    Prada Shoes - Official    hermes outlet    nbastore    Online Oyun    kate spade    coach outlet online    Louis Vuitton Outlet    burberry outlet sale    Air Max 90 Femme    michael kors    oakley outlet    coach handbags sale    Air Max 1 Homme    pandora rings uk    articles    coach factory outlet    ray ban sunglasses    Nike Air Max 90 Mes    myhermes parcel shop    kate spade canada    Prada Shoes - Official    ray ban justin    michael kors australia    michael kors australia    fun games for kids    ray ban uk    Dreamland Jewelry - Official    Louis Vuitton Online    gel kayano    coach factory outlet    michael kors outlet    kate spade outlet    ray ban sunglasses    mulberry outlet    birkenstock canada    pandora uk    Nike Free Run    Engagement Rings - Official    north face outlet    Air Jordan Homme    ray ban shop    mulberry outlet    Nike Blazer Femmes    omega watches    black friday deals online    Obat Kuat Sex    Nike Free    soccer store    louis vuitton    ray ban wayfarer sunglasses    michael kors uk    pandora ring    jimmy choo heels    black friday deals    pandora necklace    ray ban sunglasses    Nike Schuhe Herren    fulam shoes    kate spade outlet    official louis vuitton    Jared Jewelry - Official">    michael kors uk    pandora outlet    Prada Sunglasses - Official    payless shoes    clb shoes sale    michael kors    Kay Jewelers - Official    puma shoes    louis vuitton us    michael kors australia    kate spade outlet    Nike Air Max 2017    puma oulet sale    timberland boots    ray ban frames    coach factory outlet online    China wholesale    michael kors australia official    nike outlet    sunglasses hut    chanel outlet    birkenstock outlet    ray-ban glasses    michael kors    Kaufen Nike Air Max 1


January 9, 2018 10:15 PM

wef said:    Chanel Outlet    payless shoes    80's Fashion    Nike Air Jordan Enfants    Michael Kors Outlet    Air Jordan Retro 3    ray ban shop    Promise Rings - Official    populaire Nike Lunarmax    puma outlet    coach factory outlet    katespade outlet    Nike Air Force    Coach Bags Outlet    NIKE Schuhe Shop    casio watches    michele watch    oakley australia    Air Jordan 10    qiqi fashion    birkenstock sandals    burberry bags outlet    michael kors shoes    Sunglasses outlet sale    Nike Air Jordan Enfants    ray ban clubmaster sunglasses    Cartier Watches    puma outlet online    hermes bag    louis vuitton outlet    coach factory outlet    clearance    prada outlet woodbury


February 10, 2018 7:23 PM

aaaa said:

April 1, 2018 5:22 PM

hgjhhj said:

April 11, 2018 11:50 PM said:

We are here to help you out with the whole procedure to Download Microsoft Office online, We not only fix your MS office setup related issues but will guide with how to get started with your new Office 2016 product once it get installed successfully.

Regards -

April 20, 2018 11:46 PM

kuhhjk said:


<h1><a href="">شبیه">">شبیه سازی با متلب</a></h1>

<h2><a href="">انجام">">انجام پروژه متلب</a></h2>

<h2><a href="">انجام پروژه دانشجویی</a></h2>

[url=]شبیه سازی با متلب[/url]

<h2><a href="">پروژه متلب</a></h2>

<a href="">پروژه متلب</a>

پروژه متلب , انجام پروژه متلب , پروژه متلب

[url=]انجام پروژه متلب[/url] , [url=]پروژه متلب[/url], [url=]انجام پروژه دانشجویی[/url]

[url=]پروژه متلب[/url]

May 1, 2018 1:56 PM

chenyingying said:


May 6, 2018 10:40 PM

linying123 said:


May 10, 2018 8:05 PM

hjkjhk said:

May 29, 2018 3:49 AM

shenyuhang said:


June 1, 2018 7:00 PM

shenyuhang said:


June 1, 2018 7:01 PM

lee said:

June 28, 2018 11:46 AM

dongdong8 said:



June 29, 2018 2:45 AM

linying123 said:



July 16, 2018 8:28 PM

dongdong8 said:



July 23, 2018 11:27 PM

shenyuhang said:


July 23, 2018 11:34 PM

AB said:

August 7, 2018 11:10 PM

sdgvsdgsd said:

August 8, 2018 7:52 AM

yaoxuemei said:


August 15, 2018 2:03 AM

qqq said:


August 15, 2018 11:38 PM

qqq said:

August 15, 2018 11:55 PM

chenjinyan said:


August 22, 2018 11:03 PM

shenyuhang said:


August 23, 2018 10:15 PM

sfgefa said:

<a href=''>Writes My essay</a></br>

<a href=''>Child Vision</a></br>

<a href=''>Tweeter Getter</a></br>

<a href=''>Cents Market Place</a></br>

<a href=''>Deti Group</a></br>

<a href=''>bannka</a></br>

<a href=''>Indian Embassy Baku</a></br>

<a href=''>kbrt</a></br>

<a href=''>Uk Towns</a></br>

<a href=''>DM Gifts</a>

August 30, 2018 1:22 AM

sdgesgtw said:

[url=]Writes My Es Say[/url]

[url=]Child Vision[/url]

[url=]Tweeter Getter[/url]

[url=]Cents Market Place[/url]



[url=]Indian Embassy Baku[/url]


[url=]Uk Towns[/url]


August 30, 2018 1:22 AM

dsfaghdf said:

August 30, 2018 1:23 AM

asfsaffas said:

August 30, 2018 11:09 PM

saaiufuysagou said:

August 31, 2018 11:04 PM

dfhyasugtfuos said:

August 31, 2018 11:04 PM

AB said:

September 4, 2018 1:23 AM

AB said:

September 6, 2018 5:12 AM

sdfasdfasdf said:

September 6, 2018 9:30 AM said: is very easy to install, download and redeem. Use of it is also simple and the user can learn the use of it easily. Online Support&help option is also available in all application which provides an instant guideline.

September 11, 2018 4:19 AM said: – Visit the link in order to Get Started with Your McAfee Security. You may easily Activate McAfee with the help of this link or you may read more in order to get more information.

September 11, 2018 4:20 AM

AB said:

September 12, 2018 1:00 AM

RAJA said:

September 12, 2018 3:26 AM

safsafsaf said:

September 12, 2018 8:32 AM

RAJA said:

September 15, 2018 5:28 AM

Dial Printer Support said:

Having tech problems with your printer? Look no further than Dial Printer Support. Call us at +1-888-621-0339 for instant tech support! We cater to HP, Canon, Brother Printers as well as HP Laptops, desktops.

October 1, 2018 11:12 PM

malaysiavisa23 said:

 Hello! This is my first visit to your blog! This is my first comment here, so I just wanted to give a quick shout out and say I genuinely enjoy reading your articles. Your blog provided us useful information. You have done an outstanding job.

<a href=''>malaysia visa singapore</a>

October 5, 2018 7:26 AM

kakakaoo said:

October 8, 2018 2:32 AM

RAJA said:

October 8, 2018 5:18 AM

chenjinyan said:



October 9, 2018 6:46 PM

chenqiuying said:


October 10, 2018 5:57 PM

AB said:

October 16, 2018 1:01 AM

RAJA said:

October 19, 2018 5:04 AM said:

Learn, how to download and setup Microsoft office software For Windows and Mac OS PC/Laptop

October 19, 2018 10:18 AM said:

Thank you for posting this article, it was really helpfull. Great Article.

October 23, 2018 12:45 PM said:

Thanks for sharing this marvelous post. I m very pleased to read this article.

October 23, 2018 12:45 PM said:


I read your post and found it quite interesting.

The post you shared is very unique and informative.

Thanks for sharing such a useful post.

October 23, 2018 12:46 PM said: – McAfee Antivirus is one of the most critically acclaimed security program across the globe. Protect your devices and data from viruses, malware, Trojan horses, worms, and other cyber threats with real-time protection and threat scanning. Get robust protection offered by McAfee by following the process (download, install, activate) on

October 24, 2018 9:00 PM said:

Download and Install Your Product Online, Setup and Install Product With 3 Simple Steps. Enter Product Key To Start Download, Install Product, Activate and Setup Your Product.

October 25, 2018 1:05 AM said:

Find how to download, introduce, activate all renditions of Microsoft Office setup and initiate on

October 25, 2018 2:33 AM

RAJA said:

October 26, 2018 12:42 AM

social media virtual assistant said:

Thanks for sharing such great information with us.

Your blog  is very unique and all information

is reliable for new readers.

<a href="">virtual servants </a>

October 27, 2018 9:29 PM

RAJA said:

October 30, 2018 5:21 AM said:

Install Office Setup – Sign-in to you microsoft account and then Enter 25 digit alphanumeric office setup product key on  country and on next to start office installation.We are the best Office Setup in US, Canada and Australia. <a href=""></a>

October 31, 2018 12:40 PM

RAJA said:

October 31, 2018 11:58 PM

Margie said:

Background Removal Services (BRS) is one of the best Clipping path service provider around the world. We offer our global customers: Raster to Vector Services, Photo Restoration Services Prices, Photo Neck Joint Service, Exposure Color Correction Service, Jewelry Photo, Retouching Services, Photo Color Correction Service, Image Mirror Effect Service, Cheap Retouching Services, Deep Etching Service, Read more

November 1, 2018 7:32 AM said:

Install Office Setup – Sign-in to you microsoft account and then Enter 25 digit alphanumeric office setup product key on  country and on next to start office installation.We are the best Office Setup in US, Canada and Australia. <a href=""></a>

November 1, 2018 1:52 PM

AB said:

November 1, 2018 11:12 PM

RAJA said:

November 2, 2018 12:27 AM

AB said:

November 4, 2018 9:24 PM

chenqiuying said:

November 4, 2018 10:39 PM

RAJA said:

November 4, 2018 11:47 PM

AB said:

November 7, 2018 4:19 AM

AB said:

November 7, 2018 11:57 PM

kakakaoo said:

November 8, 2018 2:53 AM said: access the business application on your pc after the activation with product key, you can access all the applications of office setup like word,excel etc for guide and support call us

For more visit website: <a href=""></a>

November 21, 2018 10:24 PM

RAJA said:

November 23, 2018 12:57 AM

Jack said:

December 5, 2018 9:02 AM

fdhggh said:

December 6, 2018 10:01 PM

asdsd said:

December 7, 2018 1:40 AM

RAJA said:

December 8, 2018 12:04 AM

alex said:

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information.




December 8, 2018 4:38 AM

Leave a Comment


This Blog


Privacy Statement