Home Forums SQL Server 7,2000 T-SQL How to remove Carriage Return from string? RE: How to remove Carriage Return from string?

  • This is fine but it removes all carriage returns and linefeeds, even ones you want to keep... Is there a solution for this?

    SET line1 = 'line1'

    SET line2 = 'line2'

    SET lines = line1 + CHAR(13) + CHAR(10)

    SET lines = lines + line2 + CHAR(13) + CHAR(10)

    SET lines = REPLACE(REPLACE(lines, CHAR(13),''), CHAR(10),'')

    lines = line1line2

    not ...

    line1

    line2