Arijit Ghosh
Arijit Ghosh

Reputation: 1

Connecting to Multiple Connection Strings at one click

I have to connect to some 200 DB2 Databases and pull meta data and store those data in another Master SQL Server for reporting purposes. Now, when a user clicks "run a script". The Application should get connected to one DB2 Database pull data, store it in Master SQL Server. After that, again connecting to next DB2 Database and the process goes on. It will be very helpful if someone can suggest the best possible method to store and dynamically change these connection strings one after another when the script is running. We also have to add or remove as and when new databases are turned over to us or remove if decommissioned.

Upvotes: 0

Views: 155

Answers (1)

Albert Arul prakash
Albert Arul prakash

Reputation: 156

If you use xml, it is relatively very easy to manage. Just store each connection string as a node like below

<connectionStrings>
    <connectionString />
    <connectionString />
    <connectionString />
    <connectionString />
    <connectionString />
</connectionStrings>

Now from your application (any language that can consume XML) loop through every connectionstring node and write logic to connect and store meta data within the loop.

Your task is done.

Upvotes: 0

Related Questions