Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to Repeat Header in rows 1 thru 3

Status
Not open for further replies.

MsHart2u

Programmer
Jul 16, 2003
30
US
I have a finished SSIS package in Visual Studio 2008R2 that runs beautifully:
1. exports SQL data into a flat file destination with 1 header row,
2. renames the file to include the date in file name
3. Finally, it FTPs this file to our vendors destination for upload

PROBLEM: recipient wants the header row to be repeated 3 times before details begin. Is there a way to do this??

Tab delimited flat file should look like this:

HeaderRow1 header2 header3 header4 header5 header6
HeaderRow2 header2 header3 header4 header5 header6
HeaderRow3 header2 header3 header4 header5 header6
DetailRow1 Detail2 Detail3 Detail4 Detail5 Detail6
(all other detail records follow)


Thank you in advance for all your help on this.





[blue]Kathy,
Bus Sys Analyst[/blue]
"I am always doing that which I can not do, in order that I may learn how to do it."– Pablo Picasso
The person who says it can't be done shouldn't interrupt the person who is doing it.—Chinese Proverb
 
I would really get the recipient to take it as supplied - no reason ever to have 3 headers like that.

but you can do as follows.

define the file destination without headers.

have a base file with the 3 headers you require (this could be created on the fly by another task)
before the dataflow that uses the file execute a filesystem process (other options exist) and copy the base file to the work file of the dataflow

on data flow destination file untick override data

when the dataflow runs it will add the records to the file with 3 headers and give you what you need.

Depending on the file size you could also have a a step before the renaming of the file which would do as follows.
copy "base file with headers" + "extract file" "destination file"
Not feasible on significantly big files due to extra time to copy the file and space required.



Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top