Remove line breaks in selected code
If I select some code I can press Ctrl to open a small menu where I can e.g. "Apply comma" or "Encapsulate as procedure" etc.
It would be nice to have a function to
- remove line breaks
- and / or replace line breaks with comma plus space
- and / or encapsulate as IN condition
Copy some Id's from a result set that you want to use in a IN condition
should be "formated" to
45486, 31321, 31167, 30985, 30844, 30818, 33989
We’ve got “unformat” in the actions list which’ll remove all the line breaks in the current selection.
Apologies if unformat wasn’t an obvious action for removing line breaks – we had 3 UserVoice requests asking for it that had all used the term so it seemed like a good name to use.
You can do it using the regular expression in SSMS:
1) Ctrl-H to bring up the Find And Replace window
2) Select USE -> Regular Expressions
3) Put ^\n in the Find What
4) Keep Replace With empty
5) Click Replace (All)
-- Nilesh Umaretiya (India)