How to reconfigure the column information on a flat file connection manager?

ETLUser picture ETLUser · Feb 20, 2013 · Viewed 35.9k times · Source

I have a Flat File Source that is reading data from a flat file. We have recently added a new column to this flat file.

The flat file data is inserted into a database table. To accommodate the new field in the destination component, I used the ALTER TABLE statement to add the new column to the table. That is the only change I have done.

Should the mapping between flat file and destination component automatically change? I do not see the additional column present in the flat file anywhere within the SSIS package.

How do I configure the additional column in the flat file within SSIS package so that flat file source can pass the data to the destination component?

Answer

user756519 picture user756519 · Feb 20, 2013

If you added a new column to the flat file, you need to update the Flat File Connection Manager to reflect the new changes. Flat File Connection Manager will be present under the Connection Manager tab at the bottom of the package.

Sample scenario illustrated using SSIS 2012:

Let's assume that you have a flat file with columns StateCode and StateName.

Initial flat file

When you configure the Flat File Connection Manager, you will see these columns configured under Advanced tab page as shown below.

Initial Connection Manager

If you modify the flat file to add an additional column, say by adding the new column named CountryCode.

Final flat file

The flat file connection manager will not contain the new column definition. You need to open the Flat File Connection Manager to add the new column or you could delete the Flat File Connection Manager and create a new one with the new flat file column definition.

You need to click New and select appropriate option to insert the column. You cannot move the column positions. So, make sure you select the right option to add the columns. Set the appropriate properties to define the column.

Final connection manager

When you modify source or destination schema, it will affect the source and destination components within data flow task. You might see a warning icon on the component as shown below because the component is out of sync with the metadata information of the connection manager that it is associated with.

Double-click the component showing the warning and click OK on the editor to resolve the mapping issue.

Source warning

Hope that helps.