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:

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of