Souce and Dest auto-mapping

Hi,
in my package there are several Connection Managers linking DB2 databases
and there is one "fake" CM which copies the connection string of one of the other "real" CM depending of the need.
Then I've made a Data Flow containing an OLE DB Source and a Destination Adapter.
The Destination has a "table name from variable" access through a fixed Connection Manager,
and the Source has "sql command from variable" access and uses the "fake" Connection Manager, which has "inherited" the connection string from one of the "real" CMs.
The point is:
When I drag the arrow from the OLE DB Source to the Destination, some mapping metadata are set, and then when I execute the package, it always expects to find some given columns in the source mapped to other given columns in the destination when I'd want It to map the columns by itself, depending on the
sql command(which is contained in a variable).
on the source.
(the mapping should success because source and dest always have the same names for columns)
Does anyone know how to solve this problem? Thanx.
[1260 byte] By [UmbertoGatti] at [2007-12-17]
# 1
If I understand you correctly, you want the mapping metadata of the data-flow to change at run-time depending on which table you are sourcing the data from. Is that correct?

If so, I'm afraid this can't be done. The mapping metadata of a data-flow cannot be changed at runtime.

You say: "the mapping should success because source and dest always have the same names for columns"
This is not true because although the source and destination can change, the mapping metadata cannot.

You need to build a data-flow for each table that you will be loading. Use precedence constraints in your control-flow to determine which data-flow to execute depending on which table you want to load.

Hope this helps.

-Jamie

JamieThomson at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
You're giving me bad news, but yes: this helped.
Thanx Big Smile
UmbertoGatti at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 3
I don't think this is true because the Copy Database Wizard builds a package which has a ForEach table loop and inside the loop is a package consisting of just a data flow - so the column set is dynamic.

What I'm trying to figure out is how it works .... 'cause I don't want a data flow for each table in my database.

MichaelTissington at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 4

hi mich,

did u figure out the logic behind this?

Pls post the out come if u have figured out.....

Thanx in advance..

Dev

dev15`4534345677 at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified