Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SSIS路径。合并_Ssis - Fatal编程技术网

SSIS路径。合并

SSIS路径。合并,ssis,Ssis,我有一个平面文件连接管理器。我使用一个变量来定义源路径,然后使用表达式来组合路径和文件名。是否有一个函数可以组合路径,即C#Path.combine。我希望防止在路径末尾的值可能有或可能没有\的错误如果您愿意使用表达式来处理\检查,则下面的操作可能会有所帮助,但尚未测试表达式 RIGHT( @[User::strFilePath] ,1) == "\\" ? @[User::strFilePath] + @[User::strFileName] : @[User::strFilePath] +

我有一个平面文件连接管理器。我使用一个变量来定义源路径,然后使用表达式来组合路径和文件名。是否有一个函数可以组合路径,即C#Path.combine。我希望防止在路径末尾的值可能有或可能没有\的错误

如果您愿意使用
表达式
来处理
\
检查,则下面的操作可能会有所帮助,但尚未测试表达式

RIGHT( @[User::strFilePath] ,1) == "\\" ? @[User::strFilePath] + @[User::strFileName] :  @[User::strFilePath] + "\\" + @[User::strFileName]
它使用expression
三元运算符
来决定是否需要将
\
附加到文件路径的末尾

更新了以使用
功能,而不是左和反组合功能

小清洁工

@[User::strFilePath] + (RIGHT(@[User::strFilePath] ,1) == "\\" ? "" : "\\") + @[User::strFileName]

一个可选选项:替换(@[User::strFilePath]+“\”+@[User::strFileName],“\\”,“\”)

我所知的任何本机内容,但您可以使用脚本任务调用C#Path.Combine函数。谢谢选项卡。我实际上在脚本任务中使用了它。你是说使用readwrite变量并将其设置在那里?