Solved

Stored Procedure to write a file to an FTP site

Posted on 2014-12-23
1
171 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

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

691 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