Thursday, February 16, 2012

Append Data to a Flat file

Hello,

I was wondering if there was a way for me to append data to a flat file. The reason why i ask this is because i need to create a header for the report that i am exporting.

The way i imagined this working would to be create a dts that would export the header information to a flat file and the create another dts to export the report data and appensd it to the same file that the header dts created. This might not be the correct approach so i was hoping i could get some guidance of how i can accomplish this.

I am using SQL Server 2000.

Thank you!Look up "BCP" in Books on Line (BoL) to be able to do this in SQL.|||Thank you for the tip. I will look this up and post the findings.|||Unless they have changed things, BCP is not able to append to a data file. OSQL, however, can be made to append, given the proper commandline syntax (>>). At that point, however, the whole report may as well be done with a single script in OSQL. Why is Reporting Services not being considered here?|||Right. I just tryed the bcp command and it will not append to the file. I overrights it.

I am not using reporting services because it is not installed on the box.

Can you format the file that osql creates with pipes?

No comments:

Post a Comment