February 9, 2009 at 5:55 am
Hi,
I need to pick data from CSV files one by one from a specific folder and put the data retrieved (in each CSV file) to a table in DB. At the end of processing, I need to delete all the CSV files from that specific folder.
I just heard about the For-each Enumerator in SSIS. How can I utilize For-Each enumerator for my requirement? Will there be any option in For-each container to delete CSV files? or should I have to write separate task to do that? If need to write separate task, what task would help me and how to use that?
Thanks in advance,
Suresh
Regards,
Suresh Arumugam
February 9, 2009 at 6:16 pm
Suresh Kumar (2/9/2009)
Hi,I need to pick data from CSV files one by one from a specific folder and put the data retrieved (in each CSV file) to a table in DB. At the end of processing, I need to delete all the CSV files from that specific folder.
I just heard about the For-each Enumerator in SSIS. How can I utilize For-Each enumerator for my requirement? Will there be any option in For-each container to delete CSV files? or should I have to write separate task to do that? If need to write separate task, what task would help me and how to use that?
Thanks in advance,
Suresh
Suresh,
For-Each enumerator is a container type, which contains other control flow tasks. After you setup your for-each enumerator to iterate over your CSV files, you have to setup a data flow task, which loads the data from the current for-each iteration. You have to connect the data flow task as a next step to "File System Task", with operation "Delete file" to remove the already processed file. Now all this will work if all your CSV files have the same layout and number of columns. If they are different, it will be more complicated.
I would recommend you find good books about SSIS. These are good choices:
February 10, 2009 at 12:57 am
Thanks a lot CozyRoc. I will look into the links that you prodived.
Also, I have tried using the file system Task to delete files. It works fine.
Thanks,
Suresh
Regards,
Suresh Arumugam
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply