Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Replacing Line Feed with Carriage Return

Author  Topic 

jonnieglover
Starting Member

1 Post

Posted - 2010-03-22 : 13:27:25
I have a situation that my database is being submitted with conflicting data from different browsers. Some translate a carriage return as a Line Feed and therefore my database translation tables are failing and the formatting on my website and brochures.
What I want to do is replace all the Line Feed CHAR(10) with Carriage Return CHAR(13).

I am stumped...

I can find all of them but as they have text all around them and more than one in each record I cannot figure out how to replace just the Line Feed With Carriage Return. Luckily it occurs in only one column though.

Please Help...

JG

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-03-22 : 13:29:16
just use REPLACE

REPLACE(yourcol,CHAR(10),CHAR(13))

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -