replace char(13) char(10)

char(13) is carriage return and char(10) is line feed. Different text editors/viewers will interpret it differently.

Use replace function to get all data in 1 line.
replace(replace(column_name,char(13),’ ‘),char(10),’ ‘)

when copying data which have char(13), char(10) in it to text editor/excel- we notice data showing up in different rows. FOr this scenario we replace it by ‘ ‘ to get in 1 row.

select ‘a’+char(13)+’b’
select ‘a’+char(10)+’b’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s