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 (
FullName varchar(100))
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
Quote:
Hi,
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)?
Thanks
Maz. |