Thursday, March 22, 2012

Create a flat file for each record in a table

I'm rather new to ssis and I've been reading and testing but didn't find a solution for this problem.Supose I've got a table Customer with some fields. One of the fields is CustID.I want to create as many flat files as there are Customers in the table with flat file name set to the CustID.If you could point me in a good direction, It would be nice.Greetings from Belgium

Do you want any data in these files or just the file to be created? If you just want the file to be created you could aggregate the data and then use the FileExtractor to create the file (You would need to add 2 columns one for the file name and one for the file data (empty)). If you actually want the data to flow into these files then you would most likely want to use a script component.

HTH,

Matt

|||

It sounds like you want to run a exectue SQL task to get an ADO object which holds the records you want. Then for each of these you what to push thenm to a for loop and have a dataflow inside the for loop. In the Dataflow the source would be the ADO object and you can push it to the text file.

These pages should help a bit

http://blogs.conchango.com/jamiethomson/archive/2005/12/04/2458.aspx

http://sqljunkies.com/WebLog/knight_reign/archive/category/458.aspx

|||Thanks!

No comments:

Post a Comment