Home Forums SQL Server 2008 SQL Server 2008 - General SSIS - Run a query for multiple servers and stored resultset in local database/table?! RE: SSIS - Run a query for multiple servers and stored resultset in local database/table?!

  • Here is a rough sketch of an SSIS package that will do what you want:

    1. Load the list of instances you want to iterate over into SSIS however you're doing that now.

    2. Add a Foreach loop to your Control Flow and configure it to iterate over your list of instances however you're doing that now.

    3. Setup an OLE DB Connection object and setup an Expression for the ConnectionString property to have it point to the current server in your Foreach loop.

    4. Setup another OLE DB Connection object and have it point to the DB where your "master" table resides.

    5. Add a Data Flow Task to your Control Flow.

    6. In your Data Flow Task, use an OLE DB Source to get the data from each server

    7. In your Data Flow Task, use an OLE DB Destination to load the data from the OLE DB Source into a table.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato