David F
David F

Reputation: 265

Combine multiple Replace expressions for a SSIS Derived Column

I have 3 Replace expressions that resolve in SSIS derived columns. When I attempt to combine them into 1 string they error. The replace are all in the same column. Immediately below are the 3 resolved expressions.

    REPLACE([Column1],":",":")

    REPLACE([Column1],"\n"," ")

    REPLACE([Column1],"</div>"," ")

Below are the 2 unresolved expressions I have attempted.

    REPLACE([Column1],"&#58;",":","\n"," ","</div>"," ")

    Replace(Replace([Column1],"&#58;",":"),"\n"," "),"</div>"," ")

Any assistance in getting the correct syntax is greatly appreciated.

Upvotes: 3

Views: 10312

Answers (3)

PRASHA
PRASHA

Reputation: 11

Try

(REPLACE([COURSE_CODE],"&#58;",":"))+REPLACE([COURSE_CODE],"\n"," ")+REPLACE([COURSE_CODE],"</div>"," ")

Upvotes: 0

Mr. Bhosale
Mr. Bhosale

Reputation: 3106

Check This.

\ is escape character. If you want to have single backslash literal inside SSIS string you have to escape it and use \\

Code :

REPLACE(REPLACE(REPLACE([Column1],"</div>",":"),"&#58;",":"),"\\n"," ")

in your code you missed 3rd replace function.

Code:

enter image description here

Output :

enter image description here

Upvotes: 0

SqlKindaGuy
SqlKindaGuy

Reputation: 3591

This will replace your [Column1] with all your values.

REPLACE(REPLACE(REPLACE([nightrate],"&#58;",":"),"\n"," "),"</div>"," ")

enter image description here

Upvotes: 7

Related Questions