Saturday, February 25, 2012

OSQL - appending output to a file

I want to run a job every hour which calls a stored proc using osql and apppends the results to a text file.
But it always overwrites the previous results. Is there a way of getting osql to append the results instead?Originally posted by mwilkes
I want to run a job every hour which calls a stored proc using osql and apppends the results to a text file.

But it always overwrites the previous results. Is there a way of getting osql to append the results instead?

Good old DOS, you should use batch file to append OSQL results into existing text file, named differently than the one used in OSQL output, something like:

osql ... > Osql.Txt

Type Osql.Txt >> FinalResult.Txt

Where FinalResult.Txt contains all, appended results.

Cheers, Marin

No comments:

Post a Comment