问题
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