This isn’t exactly the best thing since bread (or even sliced bread for that matter), but I figured I’d share this as I haven’t seen it written about in many places and I find it quite handy on a regular basis. If you hold down the ALT key in SSMS when you’re selecting text you can draw a box around any text that you want to highlight.
This is quite handy in a lot of places. I use it most often for code formatting, as I like things like blocks of variable declarations or table columns to line up all the way down. For example:
Or for Copy/Pasting just a section of a line:
And of course in that same vein, deleting a box:
Lots you can do with it to save some keystrokes and make things a bit quicker.



Subscribe to this blog
Briefcase
Print
Posted by Jason Brimhall on 8 February 2011
That is a handy tip. I hadn't considered that option in the past.
Posted by Seth Phelabaum on 8 February 2011
I found it completely by accident one day, same as the running a query against multiple servers by clicking new query with a registered servers folder selected(which I intend to write a post on soon as well). All of these things are starting to make me feel like I should have RTFM on SSMS =).
Posted by FabricioLimaDBA on 10 February 2011
Very good. I didn't know that...
Posted by TheSQLGuru on 12 February 2011
block-mode operations is one of the MANY awesome features of TextPad, which I have used for almost a decade now. Great to see that SSMS can do a bit of this too!
Posted by mosaic on 13 February 2011
You can do the same thing in Microsoft Word, and in Notepad2.
OT:
I have been using Notepad2 for quick code editing for ages - it is very handy for sql files if you don't want to open up SSMS. It is a very stable, small stand-alone EXE - no installation required, just run it. Syntax colouring recognises txt, sql, ps1, ini, vbs and cmd / bat syntax plus many more. Multiple undo too.
Posted by Mark on 14 February 2011
How about continuing with this, to catalogue a list of short cuts and hot keys? It would help those of us who don't use SQL as much as we would like to.
Posted by Martin Hawley on 14 February 2011
That is useful to know, especially that you can do it in Word too.
Thanks guys