How to use Sql statement in Data flow task ?

  • Hi ,

    I am importing data from xls to SQL serevr. I have done this using derived transformation as there were some datatype conversions needed. Now i want to populate another column of the destination table with data from another table. ex. count of users in DRUSER table should be imported as user(integer value) in destination table. How can i do this in the same SSIS package ?

    Regards

    Aditi

  • Have a look at the MERGE JOIN transformation - maybe that can do what you need. Difficult to know for sure without seeing examples of your data.

    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

  • I am giving you the example in the attached text file.

  • So you want the same value in every row?

    That's fairly easy - here's how.

    Create a package scope integer variable to hold the count.

    Create an Execute SQL task to run the Count query and assign the result to the variable. Put this before your DF.

    In your DF, add a derived column and assign its value from the variable.

    Map the derived column to your required destination.

    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 !

    You solved my problem..

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

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