Looping through table and running SQL Query based on value in the table

  • How can I do following things in SSIS package.

    I would like to retrieve Data from tables based on client name and date.

    I have created table in which I stored client informatino like Client_ID and Date.

    and then SQL Query is being used to filter by clientID and date.

    For exmpale

    if there are three clients in the table then query will pull data for three clients and filter by date.

    I am trying to do in SSIS but no success.

    Any article similar to this.?

  • Are you looking for three passes through one process, once for each client and date? What is the output of the process?

    There is a way but I need a little more detail first..

    CEWII

  • I have to pass two parameters in the query, ClientID and Date to filter the query.

    for example there is a table called ClientInfo and have following values

    ClientId Date

    1 5/1/2009

    2 5/1/2009

    3 5/1/2009

    I have to put this query in the ForEachLoop containter and use ClientInfo table as a record set and then run following query

    select * from tableName where clientID = @clientID and date = @date.

  • Ok, you seems to have the machanics of it worked out, what do you need me for?

    CEWII

  • How can I do this in SSIS package ? Is there any article about this.

  • This might work for you:

    http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/61987/

    If not I can describe it in more detail..

    CEWII

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

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