Wednesday, December 20, 2017

SQL SERVER - How remove line feed char from text

Use replace() function:
select b.description
from inventTable a
left outer join ecoResProductTranslation b
on b.product = a.product
where
a.itemid = '153024_0_0000' and
b.languageid = 'cs'

select replace( b.description, char(10), ' ' ) as description
from inventTable a
left outer join ecoResProductTranslation b
on b.product = a.product
where
a.itemid = '153024_0_0000' and
b.languageid = 'cs'
Output:
description
----------------------------------------
153024
Date: 12.12.2016

(1 row(s) affected)

description
----------------------------------------
153024 Date: 12.12.2016

(1 row(s) affected)

No comments:

Post a Comment