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.


Answer this question

Souce and Dest auto-mapping

  • Frango

    You're giving me bad news, but yes: this helped.
    Thanx Big Smile

  • Kerry Wano

    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.

  • Orf Quarenghi

    hi mich,

    did u figure out the logic behind this

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

    Thanx in advance..

    Dev



  • craigg75

    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

  • Souce and Dest auto-mapping