Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove Carriage Returns from Text Field 1

Status
Not open for further replies.

NEveritt

MIS
Dec 30, 2002
25
GB
I am looking to remove carriage returns from a text field for 1800 records. I can find all rows that have carriage returns by the following query.

like '%' + Char(13) + '%'

But I need to know if there is a way to remove all the carriage returns and replace them permamently with a double space.

Help would be much appreaciated

N
 
Hi,

When you say its a text field, do you mean its CHAR/VARCHAR datatype, or TEXT/ NTEXT datatype?

If its CHAR or VARCHAR, the following should work;

UPDATE <table>
SET <column> = REPLACE(<column>, char(13), ' ')


Nathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top