Sunday, April 17, 2016

SSMS Gems #2 Save the Angels.

Here's a really quick hitter that is just awesome for anyone who deals with block format lists.  

Got a list of stuff you want to edit in SSMS?

It might look like this:

Select * from Table01
Select * from Table02
Select * from Table03
Select * from Table04
Select * from Table05
            ^

(BTW, every time a Select * is performed in production, a little angel dies in heaven.)

Put your cursor right on the position following the * (just above my ^), hold down Alt and left-click dragging the cursor vertically and then left one character to highlight all of the *.  Type Name.  Booya, you have saved 5  little angels from an ignominious and sudden death.

You could do the same to highlight all of the selects and change them to delete, or update or whatever.   Delete is my favorite, to keep it clean and happy.   You should find yourself more productive when typing endlessly in SQL development.

All the little angels will thank you.