How can i do SFTP using script task?

  • How can i do SFTP using script task?

  • Which SFTP client are you using?

    blog | napalmgram@Twitter

    Training cats makes SQL Server look easy
  • I don't want to use any third party party tool.

    Is it possible?

  • Nope, it isn't possible without a 3rd party tool. As far as I know no current version of Windows ships with a built in SFTP client, though I'm happy to be corrected if anyone knows better.

    I use WinSCP for this sort of thing. It's free and fairly easy to script.

    blog | napalmgram@Twitter

    Training cats makes SQL Server look easy
  • Thanks's for your reply..

    I have implemented the SFTP using WinSCP. but, this third party tool does not return any success or failure flag,

    How can I sure that file has been sftp successfully.

  • Not easily. You're basically stuck either using a 3rd party tool (like WinSCP etc.) and calling it from the command line in an Execute Process Task, a 3rd party SSIS component (e.g. CozyRoc SFTP etc.) or a 3rd party .Net library (e.g. SharpSSH) and embedding that in your own component. Either way, you're using 3rd party code for the actual SFTP support.

  • rakeshraj.sinha (2/2/2012)


    Thanks's for your reply..

    I have implemented the SFTP using WinSCP. but, this third party tool does not return any success or failure flag,

    How can I sure that file has been sftp successfully.

    If everything works fine WinSCP returns a status of 0, any error it returns status 1.

    To properly confirm that a file's uploaded you're going to need the recieving server to respond with something meaningful. Most of my SFTP/SCP transfers are going to Unix boxes so I use WinSCP's remote execution function to run a check script on the remote box to calculate checksums, which I then pull back and compare to those taken locally.

    blog | napalmgram@Twitter

    Training cats makes SQL Server look easy
  • Thanks, will check and let you know..

  • You have 4 options that I can see:

    -3rd party command line tool

    -3rd party dll and .net script task in SSIS

    -3rd party dll and .net CLR function

    -Build your own

    I'd err on the side of a 3rd party dll so you can configure your own success decision. I'd avoid using the dll from TSQL directly if you can help it, more pain than its worth.

    -edit-

    thought of option four

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply