Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace a character by a line break in VS or SQL Server Management Studio

How to replace a character (or many characters) by a line break in VS or SQL Server Management Studio using the Find and Replace dialog?

like image 494
Martin Avatar asked Aug 24 '10 18:08

Martin


People also ask

How do I replace a new line character in SQL?

In the Find box hold down the Alt key and type 0 1 0 for the line feed and Alt 0 1 3 for the carriage return. They can now be replaced with whatever you want.

How do I replace text in SSMS?

On the Edit menu, point to Find and Replace, and then click Quick Find to open the dialog box with find options, but without replace options. On the Edit menu, point to Find and Replace, and then click Quick Replace to open the dialog box with both find options and replace options.


2 Answers

At the bottom of the "Find and Replace" dialog, check the box "Use" and select "Regular expressions"

Then in the "Replace with" box put \n

like image 186
Jay Avatar answered Sep 28 '22 10:09

Jay


You can do a regular expression find and replace on \x0d\x0a, which represents a line break.

like image 28
Garett Avatar answered Sep 28 '22 12:09

Garett