How can I loop through multiple files in a data flow task .
Right now it raeds just one file , what to do if I need to read multiple files in a data flow task
There are a lot of things you could do (like moving/deleting the files after reading), but I will keep it just at reading the files.
for each loop
in your control flow. (this has to be done in the control flow.) for each loop
, and go to the collection
tab.for each file enumerator
(in the drop-down) *.csv
under Files. Under Retrieve file name, select fully qualified
variable mapping
tab. Insert the variable CurrentFile
with an Index of 0 (should be default)CurrentFile
.Some good material (with extras):
http://www.sqlis.com/sqlis/post/Looping-over-files-with-the-Foreach-Loop.aspx
http://www.codeproject.com/Tips/803195/Foreach-File-Enumerator-in-SSIS