I have an SQL Server that has a structure as follows.
1. There is a common database that contains hundreds of stored
procedures.
2. There are also 50+ identical databases, with the same number of
tables and table structures.
3. The common stored procedures must be able to read/write data to any
of these 50+ databases. How can this be done? I can pass the database
names as a parameter in the stored procedures but that means changing
hundreds of stored procedures and over 500K lines of application code.
Is there a way I can let the stored procedures read/write to these
databases without doing all of this?
Any help will be really appreciatedYou could consider to rename all SPs by adding sp_ prfix and move them to master database. Then when you call them from any database they will execute like they are in the db they are called from. This works only if everything is happening on the same server/instance.
You could test the concept with a few SPs first.
Cheers,
Dragan
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment