Question : What would the SQL command be to remove "blank" lines from a block of text?

I copied address details from address records into order records in a SQL Server database.
The data was in separate lines in the address records (name, street, town, country, postcode etc) but is stored as a single block of text (nvarchar(2000)) in the order records.
I used the attached SQL command to fill the order address blocks, but of course that gave me blank lines where the original data was bank.

Can someone suggest the SQL syntax for getting rid of the blank lines in my order text blocks by either : a) revising my SQL syntax to do the job again but somehow ignore blank lines coming from the address records, or b) manipulate the order record data and somehow get rid of consecutive "Char(13) + Char(10)" pairs that have no text between them?

Many thanks.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
UPDATE TBL_Orders
SET Ord_InvFullAddress = 
(SELECT COALESCE (Addr_Name + Char(13) + char(10), '') + 
        COALESCE (Addr_AddrLine1 + Char(13) + char(10), '') + 
        COALESCE (Addr_AddrLine2 + Char(13) + char(10), '') +
	    COALESCE (Addr_Region + Char(13) + char(10), '') + 
        COALESCE (Addr_Town + Char(13) + char(10), '') +
        COALESCE (Addr_State + Char(13) + char(10), '') +
        COALESCE (Addr_Zip + Char(13) + char(10), '') + 
        COALESCE (Addr_Country + Char(13) + char(10), '') 
FROM TBL_Addresses
WHERE Addr_Kind = Ord_AddrKind AND Addr_Code = Ord_InvAddrCode)
WHERE Ord_AddrKind = 'C'

Answer : What would the SQL command be to remove "blank" lines from a block of text?

Hey,

have you tried something using REPLACE? Like:
1:
update TBL_Orders set Ord_InvFullAddress  =REPLACE(Ord_InvFullAddress, char(13)+char(10)+CHAR(13)+char(10), CHAR(13)+CHAR(10))
Random Solutions  
 
programming4us programming4us