Creating SP in Master database
in the master database in order to be able
to access it from any database in the server
without specifing the fully qualified name
and take an advantage of dynamic contex,
meaning the procedure will be executed in
the context of the calling database.
know:
You have to mark the SP as System in order to make the
dynamic contex thing working.
EXEC sp_MS_marksystemobject 'sp_spname'