473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Send/Receive text file using to some server using FTP

Hi All,

I have to write a stored procedure which will send/Receive text file
from/to a server by using FTP.

Is anybody have done anything on it? or know about it.
If yes, I would like to know about it. (also provide the stored
procedure code if possible)


Thanks in Adv.

T.S.Negi
Jul 20 '05 #1
3 8133
I have done this in the past using xp_cmdshell.

put simply.....

create procedure export_ftp_results
as
/* pre process the data into the output format - real table not a #tmp table
may be better*/
select output data into #tmp_table
where ......

xp_cmdshell('bcp output.txt out #tmp_table etc...)

xp_cmdshell('ftpexport.bat')

end
where ftpexport.cmd is a batch file that will call ftp with the right login
parameters etc.

likewise for import, ftp the data back then bcp in to a table and then do
any post data processing.
Regards

Chris Gadsby

"T.S.Negi" <ti********@mind-infotech.com> wrote in message
news:a1**************************@posting.google.c om...
Hi All,

I have to write a stored procedure which will send/Receive text file
from/to a server by using FTP.

Is anybody have done anything on it? or know about it.
If yes, I would like to know about it. (also provide the stored
procedure code if possible)


Thanks in Adv.

T.S.Negi

Jul 20 '05 #2
ti********@mind-infotech.com (T.S.Negi) wrote in message news:<a1**************************@posting.google. com>...
Hi All,

I have to write a stored procedure which will send/Receive text file
from/to a server by using FTP.

Is anybody have done anything on it? or know about it.
If yes, I would like to know about it. (also provide the stored
procedure code if possible)


Thanks in Adv.

T.S.Negi


You could use xp_cmdshell or the sp_OA% procedures, although there are
security issues with both those approaches. Instead, you might want to
consider doing this in a script outside the database (eg. VBScript,
Perl), and execute the script using a scheduled job. Finally, DTS has
an FTP task, but unfortunately it can only download a file, not upload
one, so I guess it wouldn't meet your requirements.

Simon
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fatih BOY | last post by:
Hi, I want to send a report from a windows application to a web page like 'report.asp' Currently i can send it via post method with a context like local=En&Username=fatih&UserId=45&Firm=none...
6
by: Tom | last post by:
I try to write a simple tcp based job queue server. It's purpose is to get commands from a client and store them in a queue (STL). The server has a thread which checks periodically the queue,...
1
by: Kitchen Bin | last post by:
Hi. I am trying to use Sockets to do multiple Send and Receives via HTTP (not simultaneously). A first pair of Send/Receives works fine and sure enough I receive HTML back, but the next...
4
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
6
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New...
2
by: Alpha | last post by:
Hi, I'm able to make connection to a server using socket connection. However, when I send a command string the server just ignores it. All command string needs to start with "0xF9" at Byte 0. ...
2
by: Malli mindwave | last post by:
Hi, We are using the yahoowebHostiing service for my company website, In that one screen of the SendComments/FeedBack section is there, I'm basically dot.net develeoper ,but yahoowebhosting not...
2
by: SvenV | last post by:
I based my program on the asynchronous client/server example on msdn. There weren't too many modifications to the original code. I just created some extra code to response to different messages. F.e....
3
by: s3raph | last post by:
Hi all, I have just inherited some code that sends a file from server to client. However, the code only works for text files, and I'm trying to modify it so that it can send and receive zipped...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.