Question : best practice for cross-database SPs


I have some cross database stored procedures (maintenance, defrag, etc.).  What's the best practice on where to store them?  I don't want to recreate the stored procedure in each of my individual databases.  Should I create a database specifically for cross-db/enterprise-wide scirpts?  Or should they be stored in one of the System databases (master, model, msdb, tempdb)?  If so, which one?


Answer : best practice for cross-database SPs

Creating a stored procedure prefixed with sp_ and placing it in the master database will make it available to any database without the need to prefix the stored procedure with the name of the database.
This would probably work best in your environment.
You could create a specific database but then you will always need to execute in the context of that database, so that could be problematic.
Random Solutions  
programming4us programming4us