VirtualObjectives

FTP Scripts

There is always a need to FTP files to and from an SQL Server. The following scripts allow you to quite easily do this.
Both of the following scripts have an attributes section where you enter the various details about what FTP server you are using, the authentication, the file(s) being transferred, and their destination.
Even though these scripts can be used for transferring multiple files, you can just specify a single file without a wild card.

Caveats:

  • These scripts will only transfer files between the SQL Server the script is running on and the FTP server. It will not transfer files to/from your PC.
  • Unfortunately, the command-line FTP program that comes with Windows is very basic. As such, the return code is always zero which indicates "success" even if the FTP script encounters a problem like an incorrect FTP server name.
  • Your FTP server may be UNIX based, so be aware that path and files names are case-sensitive. If the case is wrong, it won't find the file or path.

Getting Files from an FTP Server using FTP_MGET.sql

This script is used to transfer one or files from an FTP server to a specified path on the SQL Server.

Download FTP_MGET.zip

Putting Files on an FTP Server using FTP_MPUT.sql

This script is used to transfer one or files from the SQL Server to a specified path on an FTP server.

Download FTP_MPUT.zip