0
votes

i'm trying to transfer my data from TXT that i generate in a Data flow task to FTP library and can't do it

If i use Execute Process Task i must execute a File1.bat:

@echo off
ftp -s:fileName.txt -n

and fileName do it:

open  
172.16.60.223  
user  
username  
password  
put \\dappwstd2008\paso\Esteban_Entregas\Clientes\fileName.txt BICCONVER1/CVCUREL  
close  
bye  

If i execute the file1.bat works correctly, but can't do it with SSIS.

i tried to do the following:

Execute Process Task
Executable: D:\Users\MyName\Desktop\file1.bat
Argument: "fileName.txt"

[Execute Process Task] Error: In Executing D:\Users\EDonosoV\Desktop\file1.bat" ""fileName.txt"" at "", The process exit code was "2" while the expected was "0".

i change success value to 2 and work but CMD do nothing

Any solution?, i tried using the code of the TXT in FTP Task and have problem with RemotePath because my destiny is a library and can't open it

Thanks!

2
Sorry, why using: Argument: "fileName.txt"? - ɐlǝx
Exit code 2 means the file cannot be found. If you set the working directory to where the fileName.txt is or provide the full path as input to the bat file, I think that should correct the reference problem. - Mark Wojciechowicz

2 Answers

0
votes

Try copying your filename.txt into C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn (If you are using SSIS 2010) Similar path for 2008 or 2014

This is the "Working Directory" when you run BIDS

Or just fully qualify the path

0
votes

I solved it!

i must write the route of the folder with .bat and .txt inside in Working Directory

Executable: D:\Users\MyName\Desktop\file1.bat
Argument: "fileName.txt" (This file inside Desktop or the same folder of file1.bat)
Working Directory:D:\Users\MyName\Desktop\

And work it, transfer my Flat file to FTP!
Thanks for the comment and i hope help someone else with the same problem!