| title | Step 3: Modify the Flat File connection manager |
|---|---|
| description | Lesson 2-3: Modify the Flat File connection manager |
| author | chugugrace |
| ms.author | chugu |
| ms.date | 01/03/2019 |
| ms.service | sql |
| ms.subservice | integration-services |
| ms.topic | tutorial |
| ms.custom | sfi-ropc-nochange |
[!INCLUDEsqlserver-ssis]
In this task, you modify the Flat File connection manager from Lesson 1. That Flat File connection manager is configured to statically load a single file. To enable the Flat File connection manager to iteratively load files, you change the ConnectionString property of the connection manager to use the user-defined variable User::varFileName, which contains the path of the file to be loaded at run time.
By modifying the connection manager to use the value of the user-defined variable to change the ConnectionString property, the connection manager connects to different flat files. At run time, each iteration of the Foreach Loop container updates the User::varFileName variable. Updating the variable, in turn, causes the connection manager to connect to a different flat file, and the data flow task to process a different set of data.
-
In the Connection Managers pane, right-click Sample Flat File Source Data, and select Properties.
-
In the Properties window make sure the PackagePath starts with \Package.Connections. If not, in the Connection Managers pane, right-click Sample Flat File Source Data, and select Convert to Package Connection
-
In the Properties window, for Expressions, select the empty cell, and then select the ellipsis button (...).
-
In the Property Expressions Editor dialog, in the Property column, select ConnectionString.
-
In the Expression column, select the ellipsis button (...) to open the Expression Builder dialog box.
-
In the Expression Builder dialog, expand the Variables node.
-
Drag the variable User::varFileName into the Expression box.
-
Select OK to close the Expression Builder dialog.
-
Select OK again to close the Property Expressions Editor dialog.