dfincham28
asked on
SSIS Dynamic Column Mapping to Destination Columns
Hi Experts
Scenario: I have a flat file with different column names to the destination table in SQL.
How should I approach this problem?
Currently I'm trying to use a script task. I'm creating a package manually in the script task and I'm creating the connections to the 2 datasources manually in the package as well. So far I have managed to get hold of the collection of columns from the flat file. I wanted to get hold of the collection of columns from destination table in SQL and then map the columns together manually. I cannot get access to the destination columns so that I can loop through both sets of columns and map them appropriately.
Is this the right way to do this or is there and easier way?
Thanks
Scenario: I have a flat file with different column names to the destination table in SQL.
How should I approach this problem?
Currently I'm trying to use a script task. I'm creating a package manually in the script task and I'm creating the connections to the 2 datasources manually in the package as well. So far I have managed to get hold of the collection of columns from the flat file. I wanted to get hold of the collection of columns from destination table in SQL and then map the columns together manually. I cannot get access to the destination columns so that I can loop through both sets of columns and map them appropriately.
Is this the right way to do this or is there and easier way?
Thanks
The easiest way is to use the OLE DB Destination Editor. The column names don't have to match.
ASKER
Hi
Sorry I should have been more clear with my question. We are not using the designer because the columns will be determined at runtime. The column mappings will be held in a SQL table which we will use in the script to do the mapping.
Thanks
Sorry I should have been more clear with my question. We are not using the designer because the columns will be determined at runtime. The column mappings will be held in a SQL table which we will use in the script to do the mapping.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sounds brilliant!
Sorry I wasn't able to help.
Sorry I wasn't able to help.
ASKER
My answer was the most accurate
Hello @dfincham28, can you post the package?
Thanks
Thanks