Link to home
Create AccountLog in
Microsoft SQL Server

Microsoft SQL Server

--

Questions

--

Followers

Top Experts

Avatar of dfincham28
dfincham28

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

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Simone BSimone B🇨🇦

The easiest way is to use the OLE DB Destination Editor. The column names don't have to match.

User generated image

Avatar of dfincham28dfincham28

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

ASKER CERTIFIED SOLUTION
Avatar of dfincham28dfincham28

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of Simone BSimone B🇨🇦

Sounds brilliant!

Sorry I wasn't able to help.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


My answer was the most accurate

Hello @dfincham28, can you post the package?

Thanks
Microsoft SQL Server

Microsoft SQL Server

--

Questions

--

Followers

Top Experts

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.