Link to home
Start Free TrialLog in
Avatar of Dabas
DabasFlag for Australia

asked on

Shared Stored Procedures

Please refer to

https://www.experts-exchange.com/questions/20517698/Database-Context-and-referencing-user-tables.html#7969124 "Database Context and referencing user tables"

I have a similar situation to the one in the question above.

I want to be able to share stored procedures between similarly structured databases, and the solution presented suits me fine, but....

1) I have created a few sample test stored procedures in Master, and now I want to either delete them, change them or rename them, but since they are marked system, I am not allowed to. How do I do that? (For obvious reasons there is no sp_unmarkSystem!)

2) I am unconfortable with resorting to the Master table to solve this. Is there another solution to this situation that does not use the Master Database?

Dabas
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
And here is a very good explanation on the subject:
http://www.windowsitpro.com/Article/ArticleID/22920/22920.html
Avatar of Dabas

ASKER

Thanks Anthony.
I also had a look at that stored procedure.
In short, after reading through it,  I prefered to seek advice here rather than stick my fingers into the Master Database....

Dabas
>>I prefered to seek advice here rather than stick my fingers into the Master Database....<<
I don't blame you.  I would not do what you are doing in the first place, but that is just me  ...

Here is Scott's solution to your problem:
https://www.experts-exchange.com/questions/20529165/SQL-System-Stored-Procedure-Maintenance.html

Notice how he is just fliping the bits back.

I would wait for his comment to award him the points.

P.S. Make sure you have a good backup of the Master database.
Avatar of Dabas

ASKER

G'day Anthony:

Thanks for the link, and yes it works! (See my note at the end of that question)
I will wait for Scott before allocating points, but would also like to hear of alternatives that do not force my fingers to tremble when I type USE MASTER

Dabas
You are a braver man than I.
Avatar of Dabas

ASKER

acperkins:
> I would wait for his comment to award him the points.
Well, Scott never showed up, and there was nobody else to award the points to.....

Dabas