Header rows repeated in Flat File Destination

  • I am extracting file from a Flat File source into a SQL table, then shredding one row at a time thru a For Each Loop. While in the For each loop I am transforming some data and then writing the results to a Flat File Destination. My first issue was with each iteration thru the For Each loop, the previous inserts into the destination were being over written. I corrected this by unchecking "Overwrite data in file", now my problem is that for each iteration, the header row is being written each time with the data that I want.

    I need the header row, but only one time at the beginning of the file.

    How can I overcome the header being written each time?

    Any and all help will be greatly appreciated.

  • You can write the header row once manually, and configure the flat file connection manager to not have a header row.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Agreed with Koen.. But instead of writing the header manually once (i.e. if you want the whole thing to be automated) you can do this :

    1) Create a file say FileX using a DFT which would write only the header but no data rows.

    2) Using another DFT write data rows to file created in step 1 i.e. FileX.

    Hope this is of some good .. 🙂

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply