SSIS for each File Enumerator for multiple file filters

Is it possible in SQL 2008 (SSIS) to specify multiple file filters in each outline control?

Something like HH *. * and U *. *.

This or a cool workaround would be great.

Thank,

+2


source to share


4 answers


I don't think it is possible to do multiple types of files. The only way I know is to do *.*

conditional logic as well.



+2


source


How about a regex-enabled foreach loop? http://microsoft-ssis.blogspot.com/2012/04/custom-ssis-component-foreach-file.html



enter image description here

+2


source


Multiple file extensions can be specified. All you have to do is specify in the Files: section of the Foreach SampleFileSpec * loop editor. * Which will extract any files that start with SampleFileSpec, regardless of the file type or other trailing characters. You can also create an expression in the FileSpec of the Loop Loop editor.

If you need to handle multiple known file schemas, you can add multiple data streams to the Loop Loop Container and set the enabled flag for the conditional statement based data stream.

The only advantage I can see with this is that you only have to loop over the folder once with the For Each Loop Container. I would recommend having multiple Container Containers with their own dedicated data streams. This would make it easier to save the code for the future.

Does this help solve your problem? What use case are you trying to solve that will not be better handled by separate Container Containers?

0


source


Another option is that I prefer to call "subpackage". In your case, the package will only contain one ForEach loop, configured to loop over the FileSpec as configured in the package variable. The package itself will get the value for the FileSpec variable through the Parent Package Configuration .

This way you have a generic package that does what you expect it to do, callable from any other package. To process files with two different filters, all you have to do is call the batch twice, each time with a different variable value.

If you disagree with the configurations of the parent package, you can avoid this by calling the package using the Execute Process task, which calls dtexec.exe and the parameter value is passed through the Arguments property.

0


source







All Articles