How can I remove empty lines in SQL Server Management Studio (SSMS)?
You can do it using the regular expression in SSMS:
- Ctrl-H to bring up the Find And Replace window
- Select USE -> Regular Expressions
- Put ^\n in the Find What
- Keep Replace With empty
- Click Replace (All)
Good luck
I have gone through the below steps, and it worked for me.
- Menu Tools → Customize → Commands → Add command → Edit → Delete blank line → OK.
- The Delete Blank Lines menu appears in beside the File menu.
- Open/Select Query - Click "Delete Blank Lines".
- Enjoy.
You can use: Find and replace
- Find what: \n\n
- Replace with: \n
- use: 'regular expressions'
it is described here:
http://my.safaribooksonline.com/book/databases/microsoft-sql-server/9781617290473/using-regular-expressions-in-ssms/ch21lev1sec1#X2ludGVybmFsX0h0bWxWaWV3P3htbGlkPTk3ODE2MTcyOTA0NzMlMkZjaDIxbGV2MXNlYzImcXVlcnk9