How to call SFTP using ssis script task RRS feed

  • Question

  • Hi Team,

    Have stored sftp data into sql table as shown in bellow.

    AccountNumber SFTPUser SFTPPassword SFTPURL Email IsActive
    ACN1 UserName Password 1
    ACN2 UserName Password 1
    ACN3 UserName Password 1
    ACN4 UserName Password 1
    ACN5 UserName Password 1
    ACN6 UserName Password 1
    ACN7 UserName Password 1
    ACN8 UserName Password 1
    ACN9 UserName Password 1
    ACN10 UserName Password 1

    How to call the these many sftp server one by one using script task. Please help on this issue.

    Thanks Bala Narasimha

    Previously am using bellow script for calling sftp server

    //scriptContent.AppendLine("# Connect to SFTP server using a password");
                scriptContent.AppendLine(string.Format("open s"));

                //scriptContent.AppendLine("# Upload file");
                scriptContent.AppendLine(string.Format("put {0}", "F:\\NewFolder\\@AccountNumber_" + theDate.ToString("yyyyMMdd") + ".csv"));

                scriptContent.AppendLine("# Disconnect");

    But now have more than 20 sftp server to fetching data.

    • Edited by BaluChalla Friday, June 14, 2019 4:24 AM update key information
    Friday, June 14, 2019 3:48 AM

All replies

  • Hi BaluChalla,

    According to your issue, we could use Execute SQL Task and Foreach Loop Container.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, June 14, 2019 10:10 AM
  • I would recommend you check the commercial COZYROC File Transfer Task which provides support for SFTP protocol.

    SSIS Tasks Components Scripts Services |

    Saturday, June 15, 2019 10:19 PM