SFTP file transfer in SSIS

牧云@^-^@ 提交于 2019-12-01 04:38:07

You didn't really explain us what (if anything) goes wrong.

In general, problems like this are covered in WinSCP FAQ My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?

See also WinSCP article SFTP Task for SSIS/SSDT.

Though, to be more concrete, there are three clear issues, addressed below.


You have created a WinSCP stored site in an interactive Windows session. By default WinSCP stores site information to HKCU hive of Windows registry. Your SSIS session has no access to that hive.

Ideally, you should create a standalone script, that does not depend on a stored configuration. That particularly mean that your open command should contain credentials and a fingerprint of hostkey, like:

open sftp://username:password@TS_NEW.com -hostkey=...

WinSCP GUI can generate such script for you.


Another problem is that your cd command should really be lcd and the path must be enclosed to quotes as it contains spaces.

lcd "C:\Users\zaccheut\Documents\Analytics Project 2018\ThoughtSpot\SSIS File"

Similarly, the path to the script in WinSCP arguments must be enclosed to quotes as it contains spaces:

/script="C:\Users\zaccheut\Documents\Visual Studio 2012\Projects\Skynet Refreshes\Skynet Refreshes\local2remote.txt"

You should also add /log switch to WinSCP arguments to enable session logging. That will help you a lot with debugging. Generated script (above) shows that too.

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