variables in OLE DB Source - SQL Command

  • Hello

    I'm quite new to SSIS so my question might be easy for you.

    I need to take data from a few tables, transform them and save them in the other table. Cause every table has COMPANY column, I need to select only data where COMPANY = 'myCompany'

    I used OLE DB Source component with 'SQL command' in Data access mode to load data from source database.

    Obviously I don't want to use 'myCompany' string in every SQL query for every table. I wanted variable @company to be used.

    Unfortunately it doesn't work...

    Can anyone help me with this topic?

    I wondered if there is any Filter component in Data Flow Transformations?

    Thanks.

    Pawel

  • What you want is

    where fCompany = ?

    Then you would do the parameter mapping linking the "?" to a DTS Variable

  • Thank for you reply.

    I've tried to write a query with ? and map my User::company variable to Parameter0 parameter, but I get:

    No value given for one or more required parameters. (Microsoft SQL Native Client)

    Is there anything else I need to do to connect parameter with a variable?

    Pawel

  • OK, it works. I just cannot see the Preview.

    Thanks for help

    Pawel

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

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