Nested foreach loop containers

  • I know how to build an SSIS package using a for each loop container.

    But how do I build an SSIS package which has nested for eachloop containers.
    My idea:
    Execute SQL task - gives list of server names
    Outer For each loop container - holds the list of server values in ADO Enumerator and also points to the existing server using a variable(currentserver).

    Now I need an inner for each loop container inside this outer one.
    As my outer for each will have serverlist(variable) and currentserver(variable)
    Now using the currentserver variable I need an execute sql task which holds the list of databases in this currentserver(variable).
    Against each of this database I need to run a query(using dataflow task).I will be storing the sql query results in a sql table(oledb source
    and oledb destination is used query and store query results.)

    I declared 4 variables
    currentserver
    serverlist
    currentdatabase
    databaselist

    I cant find any online resources.
    Any guidance is appreciated.

  • This sounds like the sort of thing that David Bird went through as the core of his SQL Overview system.  There's a series of articles - the first one discusses the basic server list / SSIS processing core that you could adapt to your own requirement.

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

Viewing 2 posts - 1 through 1 (of 1 total)

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