Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Stored Procedure for different databases

Author  Topic 

truthseeker
Starting Member

15 Posts

Posted - 2010-09-27 : 15:01:13
I have a stored procedure in one database which I want to execute for 3 other similar databases.

Let's say I have database1, database2, database3, database4. Most tables are similar in all the databases. The stored procedure I have is in database1 which does some processing in one particular table. Rather than copying that stored procedure to each of the databases, is it possible to execute that stored procedure for the different database with their respective similar tables?

Thanks!

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-09-27 : 15:33:05
Not really, the best practice is to create the procedure in all the applicable databases.
Go to Top of Page

truthseeker
Starting Member

15 Posts

Posted - 2010-09-27 : 15:47:04
I have no choice then... <sigh>...

But if that is the best practice, then that's the way to go.

Thanks!
Go to Top of Page
   

- Advertisement -