Removing new line character - 07-15-2005 , 11:49 PM
Does anyone know a SQL statement that would remove all the \r\n (new line
character) from a column in the database (if it exists)?
Re: Removing new line character - 07-17-2005 , 09:29 AM
I assume by /r/n you are actually looking for ascii 13 and 10. Use the
replace function like below. However, I usually change each to a blank
space instead of just removing them.
Create table #Test (
Declare @insertvalue varchar (100)
set @insertvalue = 'John' + char(13) + char(10) + 'Doe'
insert into #Test values (@insertvalue)
select * from #Test
update #Test set FullName = REPLACE ( FullName , char(13) , '')
update #Test set FullName = REPLACE ( FullName , char(10) , '')
drop table #Test
"Maziar Aflatoun" <maz00 (AT) rogers (DOT) com> wrote