Hello,
Currently we have one database for each of our clients (not my choice, came into this system) and have some standard scripts that are run when new data is loaded to the system.
As it is now, I have all this wrapped into a SP and each DB has a copy of this SP. Needless to say, maintenance is a pain. Also, we are starting to do DB-specific things for some clients and always making changes to the script.
I would like for each DB to have a individualized SP that does any specific stuff and then calls the standard SP in a centralized location.
I know 'Use Database' command doesn't work in SP and I could concatenate all the code into a variable and use SP_EXECUTESQL to run this. Can't\don't want to go this way because the Code is 3000+ lines.
Any ideas on how to call a centralized SP to run on a specified DB?
Thanks
Currently we have one database for each of our clients (not my choice, came into this system) and have some standard scripts that are run when new data is loaded to the system.
As it is now, I have all this wrapped into a SP and each DB has a copy of this SP. Needless to say, maintenance is a pain. Also, we are starting to do DB-specific things for some clients and always making changes to the script.
I would like for each DB to have a individualized SP that does any specific stuff and then calls the standard SP in a centralized location.
I know 'Use Database' command doesn't work in SP and I could concatenate all the code into a variable and use SP_EXECUTESQL to run this. Can't\don't want to go this way because the Code is 3000+ lines.
Any ideas on how to call a centralized SP to run on a specified DB?
Thanks