jeffrey_b_lee
asked on
Removing one CR/ LF and/or multiple CR/LF from a single field
We'd like to remove the CR/LF from a single field called "ADDITIONAL_INFO". The tricky part is, is that there may be one or more CR/LF within the data. After the CR/LF(s) are removed we need a space between the data. There may be CR/LF at the beginning and at the end of the field.
For example, "JOHN DOE <cr/lf> <cr/lf> AND JANE DOE <cr/lf>" would become "JOHN DOE AND JANE DOE" as the field.
PS: We are using SQL Server to connect to DB2 (if that matters).
For example, "JOHN DOE <cr/lf> <cr/lf> AND JANE DOE <cr/lf>" would become "JOHN DOE AND JANE DOE" as the field.
PS: We are using SQL Server to connect to DB2 (if that matters).
is this a linked server to db2 or what?
declare @CRLF varchar(2)
set @CRLF = CHAR(13) + CHAR(10)
select .... replace(ADDITIONAL_INFO,@C RLF,'')
from
set @CRLF = CHAR(13) + CHAR(10)
select .... replace(ADDITIONAL_INFO,@C
from
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.