How to registered a stored procedure so that from all database it can be accessed

  • Hello,

           I have created a common stored procedure.I want to execute that stored procedure from all database without executing that script in all database.How can I do that?Please give me reply asap.

    Regards

    Niladri


    Thanks & Regards,

    Niladri Kumar Saha

  • Create it in master and prefix it with sp_

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • An alternative to Frank's wisdom (as always) is to create the SP in a common user database and just have EXEC DATABASE.OWNER.PROC statements elsewhere.

    Of course Frank's way takes care of permissions, easier, etc..  But I am sure that there will be people that don't read prior posts and will come up with this more cumbersome approach...



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • Hey, I don't advocate creating user-defined things in master. I would rather prefer your approach with a separate DB for this, but the OP wrote "reply asap", and the "master" way is probably the quickest.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • LOL.  I would like to think that developers/DBAs, etc...  would be allowed the "luxury" of creating a user-defined database for storing common sp's but you always have the bean counter/capacity people that go..... WHY do you need that when you already have (n) other databases....

    Unfortunately, your way placates the low-techs and allows access to the procs by proxy of public (I think) and is the easy way....



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply