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 2000 Forums
 Transact-SQL (2000)
 Replace carriage return

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-08-01 : 16:22:52
I have one column in a table that i need to replace the carriage return with a blank.

There could be several of these i.e
The carriage return big brown fox carriage return jumps over lazy carriage return.

I need to update the table for all occurrences.

Thanks

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-01 : 16:25:52
I think its one of CHAR(10) or CHAR(13).

UPDATE Table
SET Column = Replace (Column , CHAR(10), '')
WHERE .....

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-08-01 : 20:08:17
Thanks

If there are two carriage returns in the text...will it do all of them or just the first one.

Cheers
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-01 : 20:22:53
What happened when you tried?



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2007-08-05 : 07:25:08
It worked great thanks very much.
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2007-08-06 : 07:46:41
BTW and FYI...

CHAR(10) = NewLine (or line feed)
CHAR(13) = Carriage Return


--Jeff Moden
Go to Top of Page

jonasporter
Starting Member

1 Post

Posted - 2011-05-25 : 13:43:46
Awesome. Easy and worked great. Thanks
Go to Top of Page
   

- Advertisement -