为SSIS派生列组合多个Replace表达式

时间:2017-10-31 19:50:08

标签: ssis expression derived-column

我有3个在SSIS派生列中解析的替换表达式。当我尝试将它们组合成1个字符串时,它们会出错。替换都在同一列中。紧接着是3个已解决的表达式。

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

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

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

以下是我尝试过的两个未解决的表达方式。

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

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

非常感谢您获取正确语法的任何帮助。

3 个答案:

答案 0 :(得分:0)

这将用您的所有值替换[Column1]。

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

enter image description here

答案 1 :(得分:0)

检查这个。

\是转义字符。如果你想在SSIS字符串中有单个反斜杠文字,你必须将其转义并使用\\

代码:

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

在您的代码中,您错过了第3次替换功能。

  

代码:

enter image description here

  

输出:

enter image description here

答案 2 :(得分:-1)

尝试

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