Ole db command help

  • I'm running into small problem with my DATA Flow task.

    My requirement is to populate one table from CSV source.

    But the destination table (say mytable) has 5 column out of which 3 are filled by excel sheet and the other 2 are filled by query.

    All the column in table are NOT NULL.

    My query to populate other 2 cols looks like

    select @muter = COUNT(duser), @status= dstatus from DUSER where DUSERNAME = 'administrator'.

    i.e value of @muter and @status should be filled in those 2 cols of mytable.

    Now in data flow I have CSV source and OLE DB as destination. BUt on Mapping I can only map 3 cols and the other 2 cols are left out.

    How can map this to my OLE DB destination without having to play with table schema.

    Any idea if this can be done in OLE DB command.

  • Use Derived Column transformation.

    Csv Input --> derived column transformation --> OLEDB destination

  • how to write select col from table 1 in derived column editor?

  • Create two variables v1 and v2 and populate the values using SQL task.

    There is an option in derived column (add as a new column). You can choose the values from these two variables. 3 input columns from CSV + 2 columns from derived column transformation. You can then import all the 5 columns to your OLEDB destination table.

    Books online should help u.

  • Thanks.

    It worked.

    But now stuck with another derived column problem for date

  • I am glad it worked 🙂

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

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