Foreach Loop Container: looping through files using File Enumerator
The most common type of enumerator, the Foreach Loop Container with file enumerator, is used in this recipe. This type of container loops through a list of files in the filesystem and executes some type of action that should be taken inside the respective container.
If a connection exists inside this container, an essential configuration associated with this container type is to pass this connection dynamically creating the connection string based on expressions with the filename provided by the container and read in each execution.
Getting ready
To get ready for this recipe, use the following steps:
Open SQL Server Data Tools (SSDT) and create a new SSIS project.
Provide a name and a location for the SSIS project and proceed.
Select the package created by default and rename it to
P01_ForEachLoop_Files.dtsx
.
How to do it...
Create SSIS variables to pass dynamically the directory and filename of each file that will be processed in...