This solution will take the same general form as any other SSIS solution that needs to perform the same task multiple times.
Create a Connection Manager. I'm assuming OLE DB will suit your purpose and point it at the first instance. I will refer to it as SRC (source).
Create a second Connection Manager for your central audit server. I will refer to it as DST (destination).
You will want to use add a Foreach Loop Container onto the canvas. This will consume a list of values (your servers) to enable you to change the Connection Manager for each value in the list.
Add a Data Flow task.
Add an OLE DB Source component. Use the Connection Manaager SRC and change your query type from Table to Query and write your query (
SELECT @@version as ServerVersion
). Your query can be whatever data you need to acquire from the source systems but the metadata must remain consistent across all your instances. Columns cannot change data types.Add an OLE DB Destination component. Use the Connection Manager DST and select the table you wish to have the auditing data written to. Ensure that the "Fast Load" is selected to get optimal performance.
Server list source - I have not addressed this as this is dependent on how you have defined your list.
Execute SQL Task
If you have your servers in a table, then you can simply query it and store those values in an SSIS Variable of type Object. Wire the Execute SQL Task to point to the Foreach Loop. You will then modify theForeach Loop Container
to shred the list. If you search on that term, you'll have a host of examples walking you through it.If you have a static, predefined list, you can change the enumerator type on the Foreach Loop Container and simply add each value in there.
Web service task - Perhaps you have a centralized service that emits some XML for you to consume. Shred that XML in your Foreach Loop Container.
WMI It might be possible to use WMI to find all the SQL Servers on your network. Experiment, have fun
Expression - The net result of all this shredding is that for each value in your list, you will pop a value out of your list into an SSIS Variable. You will need to then use this Variable (server, server + instance) to make the
SRC
change each time the loop enumerates (otherwise you'll run the same query on the same server N times). This is done by right-clicking on the SRC Connection Manager and choosing Properties. In the Properties window, you will find Expressions and click the ellipses...
I find it's simpler to just change the wholeConnectionString
property but you might be able to get by with just changing the Server/ServerName value.
At this point, you should have 2-3 objects on your Control Flow canvas, 2 Connection Managers, 1 of those Connection Managers has an Expression on it and 1-2 Variables defined.