Maybe what I need is not a system stored proc.
It is not working on the system, whatever that may entail. It is for an application, a report, that runs against many databases, all of which have the same structure. Now I could put copies of my proc_report_interesting_facts in every single database, but that would be tedious.
So I put it in master and name it sp_report_interesting_facts. I find that when I
Code:
USE DBTwo
EXECUTE sp_report_interesting_facts
I get no rows.
Yes, the copy in DBTwo yields rows.
Code:
USE DBTwo
EXECUTE proc_report_interesting_facts
Some years ago, in this forum, from a well-regarded expert member, I learned that one must(?) use the undocumented system proc, sp_MS_marksystemobject, in order to run system procs from other than master. Indeed when I
Code:
USE master
EXECUTE sp_MS_marksystemobject 'sp_report_interesting_facts'
I can now
Code:
USE DBTwo
EXECUTE sp_report_interesting_facts
and get some rows.
Considering that sp_MS_marksystemobject is undocumented, how might I acccomplish this "legally"?