Thursday, April 21, 2016

SSMS Gems #4

When editing in SSMS and you want to delete a whole line, do you highlight it and then click delete?  Ever mess that up and have to CTRL-Z a few times, or worse, not CTRL-Z and not notice you got more or less than you wanted to get?

Type out a line you want to get rid of - maybe it is already commented out in a query.  Place your cursor anywhere on that line.  Hold Shift and hit the keyboard Delete button.  The whole line is destroyed and everything below moves up.

Want to comment out a section quickly? Enable the Text Editor menu (Right-Click on a menu above and check Text Editor)  Highlight the section you want to comment out and click the selection comment icon.   This one is so handy, I keep the text editor up all the time.

 
By the way, you can customize any of the menus with any available command.  You could grab this item and put it into your own custom spot if you don't want to lose any space on your interface.