Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««23456»»

No SFTP Task Component in SSIS 2005/2008? No Problem! Expand / Collapse
Author
Message
Posted Tuesday, August 16, 2011 10:23 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 26, 2015 9:09 AM
Points: 13, Visits: 276
Peter, thank you. I actually don't need to change a directory. I might want to do it in the future but for now a directory where psftp.ext is sitting is fine.
I ran the same command I generat inside the code but manually by opening the psftp and I was able to copy the file.
Since I was able to copy a file from my machine to the server, I don't think the problem is with the credentials/accounts used (me vs. SSIS). I am stumled upon this really.....
Post #1160656
Posted Tuesday, August 16, 2011 10:45 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 26, 2015 9:09 AM
Points: 13, Visits: 276
This is very weird but when I added lcd and created a subfolder within the folder that contains the psftp.exe, I was able to copy the file! I tried wildcard to copy all .xml files and that did not work.... Hmmm, at least copying one file works.
Thank you, Peter!
Post #1160671
Posted Tuesday, August 16, 2011 11:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 17, 2012 1:25 PM
Points: 9, Visits: 64
for the wildcard you need to use mget instead of get (as per putty docs)
Post #1160693
Posted Tuesday, August 16, 2011 12:23 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, May 26, 2015 9:09 AM
Points: 13, Visits: 276
Yes, I just figured that out. Thank you!
Post #1160739
Posted Thursday, May 17, 2012 1:11 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, January 13, 2015 9:11 AM
Points: 166, Visits: 733
Hello,

I have read the article and the discussion with interest. I've tried to build and run a package that moves a file on our company's network to a test SFTP location.

I've attached an email task to the OnError event. I'm not getting any errors via email or when I see the window when I am running the package.

Unfortunately, the package hasn't yet worked. I'm wondering if that is because putty needs to have a private key specified. (When I connect via WinSCP to see if the file is where I am trying to put it, I need to specify the private key.)

If the private key is the problem, how would I implement that in the original solution?

thanks,
Post #1302094
Posted Thursday, May 17, 2012 1:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 17, 2012 1:25 PM
Points: 9, Visits: 64
I've dropped the putty solution in favor of ssissftp.codeplex.com, a custom package that has worked very well for me.
Post #1302106
Posted Wednesday, December 5, 2012 8:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 7, 2015 10:08 AM
Points: 3, Visits: 235
Hi Mark,
Great post on the C# script. I'm a complete newbie with this. Do you have a download version of the script?
Post #1393057
Posted Thursday, March 13, 2014 8:25 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, August 19, 2015 8:22 AM
Points: 140, Visits: 998
I have just written an article on an SFTP open source custom task component that works much more reliably than this method:

"SFTP, encrypt or compress data files in SSIS using custom components"
Post #1550742
Posted Tuesday, May 5, 2015 3:50 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, May 11, 2015 9:15 AM
Points: 6, Visits: 24
I download the 'SftpScriptTaskDemo.dtsx', also download 'psftp.exe' and placed it in 'C:\psftp\psftp.exe', and imported into my SSIS project. I modified the SFTP's credentials...It run fine, no error but i didn't see any file upload to sftp site. what did i do wrong? Please help.
Thank you so much.

I know it's nothing wrong with the credentials because i can manual transfer the files to that server.

1st script i modifed below, and i haven't touch anything on 2nd script.
Public Sub Main()

'Load global variables with values
Dts.Variables("PathToBatch_bat").Value = "c:\psftp\psftp.bat"
Dts.Variables("PathToPsftp_exe").Value = "c:\psftp\psftp.exe"
Dts.Variables("PathToScript_sc").Value = "c:\psftp\script.sc"
Dts.Variables("ServerName").Value = "sftp.server_name.domain"
Dts.Variables("ServerUserName").Value = "username"
Dts.Variables("ServerPassword").Value = "password"
Dts.Variables("ServerSubdirectory").Value = "/sftp"
Dts.Variables("SourceSubdirectory").Value = "C:\psftp\Test.csv"

Dts.TaskResult = ScriptResults.Success

End Sub

End Class

Please help, i'm very appreciated.
Thanks again.


  Post Attachments 
sql1.png (1 view, 16.67 KB)
sql2.png (0 views, 8.48 KB)
Post #1682942
Posted Wednesday, May 6, 2015 6:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 14, 2015 11:46 AM
Points: 7, Visits: 68
I have had great success on using this many times. You may want to make the following change and try it.
Also make sure that you put your variables in the ReadWriteVaraibles on your script task.



Public Sub Main()

'Load global variables with values
Dts.Variables("PathToBatch_bat").Value = "c:\psftp\psftp.bat"
Dts.Variables("PathToPsftp_exe").Value = "c:\psftp\psftp.exe"
Dts.Variables("PathToScript_sc").Value = "c:\psftp\script.sc"
Dts.Variables("ServerName").Value = "sftp.server_name.domain"
Dts.Variables("ServerUserName").Value = "username"
Dts.Variables("ServerPassword").Value = "password"
Dts.Variables("ServerSubdirectory").Value = "/sftp" --change this to "sftp" (if root folder, just leave as ""
Dts.Variables("SourceSubdirectory").Value = "C:\psftp\Test.csv"

Dts.TaskResult = ScriptResults.Success

End Sub

End Class
Post #1683125
« Prev Topic | Next Topic »

Add to briefcase «««23456»»

Permissions Expand / Collapse