How to add a variable to Data Flow task?

  • We have a Data Flow task to load a table from one server to another. But the destination has one extra column which I have to pass from a package variable. How I can add it? In a Mapping tab it has an <ignore> drop-down option against this column, but how I can insert my variable instead of this "ignore"?

    I already have this variable and tested it with inserting from Execute SQL Task.

    I am using OLE DB source and destination.

    Thanks

  • Add a derived column in the dataflow and set its value to the variable. It will be available for mapping.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Thanks a lot Phil. It worked as expected.

    I also have another problem. I need to filter some table with 2 conditions with AND, like in SQL Server it would be

    WHERE col1 = @var1

    AND col2 = @var2

    I found that I have to build 2 Conditional Splits in sequential order. It worked well. But is it possible to have them both in one split? By my expectation it should work faster. I tried to do it but nothing worked.

    Thanks

     

  • Yes it should be possible.

    (condition 1) && (condition 2)

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply