This guide contains description of creating SFTP file transfer task for SSIS using WinSCP1).
WinSCP offers scripting interface that you can use to automate file transfers to/from SFTP server.
Before starting you should:
Start by creating WinSCP script file to transfer your files.
Below you can see basic script example for downloading file from SFTP server. For details see guide to automation or detailed documentation of scripting functionality.
option batch on option confirm off open mysession -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" get /remotepath/data.dat c:\localpath\ exit
In the script you need at least to:
mysession argument to open command with specification of SFTP connection in form sftp://username:password@hostname or use name of stored session.hostkey switch of open open command with actual fingerprint of your SFTP/SSH server hostkey;2)get command with actual paths to remote file to download from and local directory to download to.Save the script into file accessible from SSIS.
In SSIS, add new Execute Process task to control flow of your package. In the Execute Process Task Editor:
C:\Program Files\WinSCP\WinSCP.exe) into Executable;/script=<pathtoyourscript>”;
Site design by Black Gate