ssis multiple table to one file

keeking發表於2012-06-12
First, if the metadata is different. It does not work with union all .

So,

Why not just have 3 dataflow tasks one for each table with precedence constraints to have them execute in the correct order.  Each destination would use its own connection manager but they would all point to the same flat file.  The only thing you would need to do is in the flat file destination property grid (or advanced editor) make sure you set the overwrite flag to false for the second and third dataflows so that the file will be appended to.  I tested this and it worked fine for me.

Dataflow 1:
OLEDB Src (header table) --&gt FlatFile Dest (using flat file conn mgr 1 (filename = combined.csv), overwrite set to true)

Dataflow 2:
OLEDB Src (details table) --&gt FlatFile Dest (using flat file conn mgr 2 (filename = combined.csv), overwrite set to false)

Dataflow 3:
OLEDB Src (trailer table) --&gt FlatFile Dest (using flat file conn mgr 3 (filename = combined.csv), overwrite set to false)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7899089/viewspace-732601/,如需轉載,請註明出處,否則將追究法律責任。

相關文章