Passing Variable values into .bat file using Execute Process Task

妖精的绣舞 提交于 2020-06-28 04:50:26

问题


I have a ssis package that has a foreach loop container. I am trying to use .bat file within the foreach loop container using execute Process task. How do I configure my Execute Process task to pass the value into my .bat file?

Here is my sequence:
Execute sql task (passing my variable into the foreach)--> Foreach loop container----> Execute Process Task (I need help with executables, arguments....)


回答1:


  • Create 2 variables in your SSIS package.
  • The first one would have the FileName along with the entire path.
  • The other variable will have its property 'Evaluate As Expression' set to TRUE and set its Expression to the following - "local:" + @[System::FilePathVariable] + " -d HDMS:/To_HDMS/"

As soon as the second variable is referenced in your SSIS package, its expression (the one written above) would execute.

Say the FilePathVariable had the value "D:\Folder1\Folder2\FileName"; so, the value of the second variable after its expression is evaluated would be "local:D:\Folder1\Folder2\FileName -d HDMS:/To_HDMS/"

You need to pass this as an argument to your batch file. This would be done as explained in my previous post above.

In your batch file, have the command as -

C: cd \Program Files\WS_FTP Pro\ wsftppro -s %1

Please try and let us know in case it doesn't work for you.



来源:https://stackoverflow.com/questions/51257928/passing-variable-values-into-bat-file-using-execute-process-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!