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 ma
ster database. Then when you call them from any database they will execute l
ike they are in the db they are called from. This works only if everything i
s happening on the same ser
ver/instance.
You could test the concept with a few SPs first.
Cheers,
Dragan
Tuesday, February 14, 2012
Distributed Stored Procedures
Labels:
common,
contains,
database,
distributed,
follows,
hundreds,
microsoft,
mysql,
oracle,
procedures,
server,
sql,
stored,
storedprocedures,
structure
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment