SQL Server: Make a System Stored Procedure for Available to all Databases

In this post, I am going to create system objects which we can use for all SQL Server databases.

As a Database Administrator, I have created few stored procedures for selecting data from the Master database to find out some statistic.

I require to call this stored procedure from the different databases so I don’t like to create this kind of stored procedure in all databases, instead of that I choose to make it as System Object and open use for all Databases.

Create stored procedure in the Master database with the prefix “sp_”:

Execute this stored procedure from another database:

Another way is to explicitly mark the stored procedure as system object:

After this mark, check this stored procedure, is system object or not:

Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.

I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.

More from dbrnd.com

Leave a Reply

Be the First to Comment!

Notify of