I have a batch file that gets executed via the command prompt (CMD), however the same does not execute if called within a SQL job step. The batch job is opening a WINSCP session and transferring a text file from a local directory onto the client directory. The SQL job does not fail, it executes completely, however the text file is not copied. The batch file calls winscp.com as follows
cd C:\Program Files (x86)\WinSCP\winscp.com /script=C:\Test\FTPUpload.txt
and FTPUpload.txt contains the following:
option batch continue
option confirm off
open ftp://user:password@something@somthing.com -explicit
lcd C:/TestUpload/
cd /TestClient
put -delete -nopermissions -resumesupport=off *.txt
close
exit .
I have given SQL Agent account full permissions on WINSCP and also on the batch files. SQL Agent is also under the local admin. SQL Server version is SQL Server 2008 R2. At the SQL job level I have used the Type: Operating System (CmdExec).
been rattling my brains for quite some time, any help would be appreciated :)