Thursday, June 09, 2005

How to upload a file to FTP through DTS?

To upload file through DTS in SQL server 2000 create a "Execute Process Task" inside a DTS and set win32 properties to "c:\WINNT\system32\ftp.exe" and parameters to "-s:C:\WINNT\Commands.txt".

Through -s command we can pass a file to ftp.exe which executes the commands in the file. Here the name of the file is Commands.txt. The contents of the file will look like this:

open ftpURL
username
password
[cd Folder] -- optional command to change directory
del EmailList.txt -- delete the existing file as put does not replace the existing file
put c:\WINNT\EmailList.txtquit

No comments: