Solved

Stored Procedure to write a file to an FTP site

Posted on 2014-12-23
1
165 Views
Last Modified: 2015-02-20
Hi there,
is it possible to have a stored procedure to write the result of a query to an FTP site?

Lets said for instance select * from mytable where id =1

Than i have like 2 returned records and wrap those two records on a txt file and upload to an FTP site.
Is this possible and if it is can you point me to the right direction?
Thanks
0
Comment
Question by:COHFL
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
Peter Hutchison earned 500 total points
ID: 40515793
What you can do is write a batch file (.BAT) and use the SqlCmd.exe to run the query and product a result and then use the FTP program to upload the file to the FTP site.
e.g.
SQLCMD -S servername -U user -P pwd -q "query string" -o result.csv
FTP -s:ftp_cmds.txt
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question