i have a problem while excecute a ssis package with a script task for ftp transfer files. While executed by the SQL Servers Job Agent the tranfered files have a zero byte size and are totaly empty. when i execute the package manualy out of the ssis catalog in sql server 2012 it works fine. also with the account of the SQL Job Agent it works.
Localy in my Visual Studio 2012, the package is also transfer the complete file to the ftp site.
The vb code for FTP is pretty simple:
Dim cm As ConnectionManager = Dts.Connections.Add("FTP")
cm.Properties("ServerName").SetValue(cm, Dts.Variables("User::X_exporttargetserver").Value.ToString)
cm.Properties("ServerUserName").SetValue(cm, Dts.Variables("User::X_exportuser").Value.ToString)
cm.Properties("ServerPort").SetValue(cm, "21")
cm.Properties("ChunkSize").SetValue(cm, "1000")
cm.Properties("Retries").SetValue(cm, "1")
ftp.Connect()
Dim files(0) As String
files(0) = Dts.Variables("User::X_exportfilename").Value.ToString
ftp.SendFiles(files, Dts.Variables("User::X_exporttargetfilename").Value.ToString, True, False)
ftp.Close()
Does anybody know if this is a script task issue or is a problem of the sql agent?