Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 FTP task _to_ a remote site

Author  Topic 

nlocklin
Yak Posting Veteran

69 Posts

Posted - 2003-01-13 : 13:12:10
I have always been under the impression that the FTP task in SQL Server DTS was capable of two-way transmission, that is you not only FTP a file from a remote site, but that you could also use FTP to send a file to a remote server.

Unfortunately, it does not appear there is a way to FTP a file to a remote server using an FTP task in DTS. Has anyone ever built a system to send a file to a remote site? I'm starting to think about using xp_cmdshell to execute a command-line ftp, but I'm hoping to find a better way. Does anyone have any ideas?

Thanks in advance!


--
"It's not that I'm lazy... it's that I just don't care."

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-01-13 : 13:18:37
This should work:

http://www.sqlteam.com/item.asp?ItemID=6002

Whether it's "better" is a matter of opinion. If the FTP operation is fairly bulletproof then using the command-line might require fewer resources, and you can set up a script file to do a batch transfer with it. The COM approach may have other advantages depending on which FTP package you use (progress of transfer, retry and recovery, etc.)

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-01-13 : 13:22:21
If you are going to use xp_cmdshell, create a batch file. Put all of the FTP commands in this file. Then use xp_cmdshell to run the batch file.

Do you need to use DTS to FTP the file to a remote server? I ask because you could easily do the above without DTS. Do you have other SQL tasks that need to run as well?

Go to Top of Page

nlocklin
Yak Posting Veteran

69 Posts

Posted - 2003-01-13 : 17:15:26
The new article on the main page at http://www.sqlteam.com/item.asp?ItemID=12408 (Using DTS and FTP to Push Files) is exactly what I was looking for!

I'm actually FTPing flat files to our VAX mainframe, where another program will import the file into a System 1032 dataset. We do use the ODBC driver for System 1032 and it works perfectly for transfering data from the VAX, but sending data back to System 1032 that way is pretty inefficient - took 30 minutes to send 1500 rows. It takes about 3 seconds to output from SQL Server to a flat file, and 3 seconds for the program on the VAX to read the file into a dataset, so the only missing piece was getting the file there. This should solve that.

Thanks everyone!


--
"It's not that I'm lazy... it's that I just don't care."
Go to Top of Page
   

- Advertisement -