Native tooling approach
Grab a newer copy of Management Studio (2012 SP2 and 2014 are both free, fully functional, and can co-exist with your 2008 R2 tools). Then you can do this.
- Put your cursor right before the first leading
- Hold Shift+Alt, then hit the down arrow three times.
It's subtle, but you should see a faint blue vertical line here indicating that keystrokes will actually affect all 4 lines (or 150 lines).
If you don't want to use a more modern version of Management Studio, then just add the stuff in Excel. Insert a new column, put a single-quote in the first cell where you want it, hover over the bottom right of the cell until the cursor becomes a solid
+, then click and drag to the bottom:
Repeat for the second single-quote, commas, etc. Copy all, paste into SSMS, then do a quick replace for
Regular expression approach
Your third alternative is to use a Regular Expression, valid with all versions of SSMS
- Find what:
- Replace with:
- Look in: Selection
- Expand Find Option
- Use: Regular expression (checked)
That regular expression indicates find everything and remember what we found
Replace everything we found
\1 by wrapping it with with tic marks and a comma
If you have more complex requirements, the right chevron next to the drop down arrow on Find what lists the regular expression dialect SSMS/Visual Studio understands