Executing a sql query inside a dataflow

  • Hi All,

    How can we execute a sql query inside a dataflow by passing dataflow variables as input parameters to the query?

    I want to execute this query in some data flow component and not in the control flow

    Thanks,

    Sreelekha

  • Check out the OLE DB Command component.

    But I would advice against it, as it will fire a single statement/transaction for every row in your dataflow, resulting in serious performance loss.

    In almost all cases, it is much more performant to execute SQL queries in the control flow.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • you can use the OLEDB Command, if you have a lot of rows coming down the source then performance will suffer depending on the complexity of the statement your doing. Otherwise you can attempt to fill all the records into a table and perform a bulk update or whatever operation you intend to do on that table using the OLDEBD Command component which would provide a much faster result.

  • v.sreelekha (6/30/2011)


    How can we execute a sql query inside a dataflow by passing dataflow variables as input parameters to the query?

    I want to execute this query in some data flow component and not in the control flow

    Sreelekha

    In your OLE DB Source Editor, change the Data access mode to SQL command or SQL command from variable. You can then either build your SQL command using an expression with your parameters, or you can create a variable and create the command using an expression in much the same way.

    John

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

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