我已经在我的ssis软件包中的派生列表达式中写下了以下代码。
我从来源接收时输入值: -
Q:SOURCERV_TPCL_RVTRVT_export_all_2011-02-14_08.38.00_Emerald.xlsx
我想要:-RVT_export_all_2011-02-14_08.38.00_Emerald.xlsx
Substring(@[User::V_FilePath],LEN(@[User::V_FilePath]) - Charindex("",Reverse(@[User::V_FilePath]))+2,LEN(@[User::V_FilePath]))
在SSM中运行良好,但在SSIS中给出以下错误
dft时错误 - 加载数据[派生列[8]]:尝试解析 表达式" substring(@[user :: v_filepath],len(@[user :: v_filepath]( - charindex(" ",反向(@[user :: v_filepath](( 2,len(@[user :: v_filepath](( 失败的。令牌""在行号" 1" 1",字符编号" 68"是 未能识别。该表达无法解析,因为它包含 指定位置的无效元素
DFT时错误 - 加载数据[派生列[8]]:无法解析 表达式" substring(@[user :: v_filepath],len(@[user :: v_filepath]( - charindex(" ",反向(@[user :: v_filepath](( 2,len(@[user :: v_filepath]((。 该表达式是无效的,或者存在存储误差。
dft时错误 - 加载数据[派生列[8]]:表达式 " substring(@[user :: v_filepath],len(@[user :: v_filepath]( - charindex(" ",反向(@[user :: v_filepath](( 2,len(@[user :: v_filepath](( 在"派生列"上。 输出] .-列[filenaemfomfompat]"无效。
DFT时错误 - 加载数据[派生列[8]]:无法设置属性 派生列上的"表达式"。输出[派生列 输出] .-列[filenaemfrompat]。
请建议。预先感谢...
终于经过大量测试,我能够得到我想要的东西。
这是我使用的代码
RIGHT(@[User::V_FilePath],FINDSTRING(REVERSE(@[User::V_FilePath]),"\",1) - 1)