SSIS vars into OLEDB component

  • how can i use one variable into OLEDDB component in the select/where cluse ?

  • Your OLE DB Source component can take its SQL statement from a variable (AccessMode="SQL From a variable").

    -Jamie

     

  • Thanks, for your answer but it didn't works for me. I am trying to obtain data from a table which i have filter for date, so i wish to set date a variable and execute the OLEDB source to execute the query for obtain the results in another table. But i am trying and the OLE DB Source can not recognize:

    "select * from tableA where fieldDate=@inputDate" or

    "select * from tableA where fieldDate=?inputDate"

    where inputDate is a variable with date and scope correct.

  • the syntax is just ?

    for example:

    update tblUser set stageFlag = 1 where  username = ? and userid = ?

    you do not repleat the variable name here... it is positional where the first ? relates to the variable for username, and the second tothe variable for userid


    Cheers,

    david russell

  • i get it, thanks for a lot...

  • Note if I were you I would get intothe habit of usinng the method I suggested. It will always work whereas using parameterised queries lays you open to the vagaries of different syntaxes for different providers.

    -Jamie

     

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

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