Advertisement

02.01.2007 at 01:47PM PST, ID: 22146149
[x]
Attachment Details

Using stored procedure/tsql to output query results to text file

Asked by wppiexperts in MS SQL Server

Tags: file, output, stored, procedure, results

Greetings!

I've written a stored procedure which pulls data and dumps it into a temp table...however, I'm trying to figure out if its possible to send the data (hundreds of rows) to a text file. I've come across references to using osql but only in a batch file environment, not as part of a stored procedure.

Any suggestions on what to use in this case? Could the query results be dumped in one step, or would I have to loop through each row to output it to the text file?

Thanks for your help!Start Free Trial
 
Loading Advertisement...
 
[+][-]02.01.2007 at 01:58PM PST, ID: 18448131

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.01.2007 at 02:01PM PST, ID: 18448164

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.01.2007 at 05:17PM PST, ID: 18449279

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.01.2007 at 05:37PM PST, ID: 18449358

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: file, output, stored, procedure, results
Sign Up Now!
Solution Provided By: nmcdermaid
Participating Experts: 4
Solution Grade: A
 
 
[+][-]02.02.2007 at 08:39AM PST, ID: 18453721

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.02.2007 at 03:09PM PST, ID: 18456895

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32