We can use Regular Expression to find and replace, valid with all versions of SSMS
- Find what: {.+}
- Replace with: ‘\1’,
- 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 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
References
https://dba.stackexchange.com/questions/96371/applying-quotes-across-multiple-lines
Add to favorites