RE: How to append a SP´s result into a TXT File

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Alejandro Mesa (AlejandroMesa_at_discussions.microsoft.com)
Date: 12/21/04


Date: Tue, 21 Dec 2004 08:21:05 -0800

You can use bcp utility.

Example:

bcp "execute northwind..[sales by year] @Beginning_Date = '19960101',
@Ending_Date = '19961231'" queryout "c:\temp\sales by year.txt" -S pivotalr5
-T -w

AMB

"Jorge Luzarraga Castro" wrote:

> Hi,
>
> is it possible to save the results from a stored procedure execution, which
> returns a result set, into a text so that the results are appended. If so,
> how could I do it?
>
> I´m trying with this sentence:
> ISQL -Uxxx -Pxxx -Q"execute itf_generateinterfase '00001', '20040830',
> '20041231', 'P'" -SAcrux -dSegurosCl -o"Header.txt" -w1100 -h-1 -n -s";"
>
> but it overwrites the file header.txt everytime I execute the batch file.
>
>
> Thanks In Advance.
>
>
>
> Jorge.
>
>
>



Relevant Pages