Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SSIS and Import/Export (2008)
 Export Table to Flat File Appending Only New Rows

Author  Topic 

jcram
Starting Member

1 Post

Posted - 2010-07-24 : 16:46:23
I am trying to figure out how to write the contents of a table to a flat file on a schdule. When the task runs I only want the new rows to be appended to the flat file. Does anyone know how to do this?

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-07-24 : 18:16:24
when you create SSIS package with a simple flow: "OLE DB Source" with connection to "Flat File Destination" right click on "Flat File Destionation", select properties and under section "Custom Properties" set value Overwrite to FALSE. this will tell SSIS always to append text in flat file at the end of last row and not overwrite the whole content.

be sure to query your results in "OLE DB Source" so you always add new rows to flat file. I also suggest you to create additional "backup table" where you store all the data that is also stored in flat file and when trying to append new rows to flat file, make sure to run LookUp to check if the record is already in the flat file or not.
Go to Top of Page
   

- Advertisement -