Click to See Complete Forum and Search --> : Creating a header record


scabral79
11-15-2007, 11:41 AM
Hi,

i created a view to export some data to a flat file on a server. However, the flat file will need to have a header row with Header text, number of rows in the file and date as follows:

Header|1023|10/16/2007

Is there a way to add the header to the file before exporting or is this something that needs to be done after the file has been exported using VBScript or Perl?

Any suggestions will be helpful...

thanks
Scott

chazzy
11-16-2007, 06:35 AM
my first question is how are you creating this export file? is it done via a programming language, or somehow is the database doing it for you?

scabral79
11-16-2007, 06:39 AM
The file is being generated via a DTS package which will run an sql view and exporting the results to a text file out to a server.

chazzy
11-17-2007, 09:51 AM
I'm not overly familiar with DTS but you should be able to put a header row on it, if no other way than to just add a single select statement to put the headers on in the stored proc, then union or something like that.

but i don't know if the header's going to always make sense. are they using it for metadata or something? wouldn't it be possible to expose it as a WS instead using the reporting services? this way they'll always know what's coming. just throwing some ideas out there in case you're putting forward any consideration.