rkapukaya
rkapukaya

Reputation: 77

SSIS Dynamic Column Mapping

I am using SSIS to do data transfer from OLEDB SQL to OLEDB SQL. Both databases are SQL Server.

I have over 100 tables to transfer data from database-A to database-B (truncate-insert) and I want to do this with dynamic data task flow & one package.

Each table has different column names.

My steps:

After this configuration, when I executed package second loop takes error in the second loop of container.

Because of error, mapping wants same column mapping. Is there any way to manage dynamic column mapping or another way to transfer data in one package.

Upvotes: 0

Views: 830

Answers (1)

openball
openball

Reputation: 21

I will use a script task for this.

  1. Creat a table with the following columns A. Source connection B. Destination connection C. Source query D. Destination table In mine I have additional columns like E. Pre execute query - where I truncate data, drop indexes or cause an error on week days so it only runs on weekends, buffer size, error log, timeout etc
  2. Add a for each container and point to the table The table will have one line item for each of the hundred tables
  3. In your script task you will use the current row to make an oledb connection, execute the sql in the load query column, into the table in the destination table column, using the destination connection. I hope this makes sense.

Upvotes: 0

Related Questions