Stored Procedure :: Multiple Users

  • A developer has created a stored procedure that runs a query across mulitple databases, currently to make it work we have granted the user that the application is using to call the SP access to each of the databases........

    Is there a way I can remove the user from the databases where the user has no rights, and still have the stored procedure work?

    Thanks in advance for the help! :: MATT

  • hi,

    Yes you can by using the guest account.

    look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_security_8hpu.asp

     

    HTH

    yoav.

  • with sql2k sp3 one can have Cross DB Ownership Chaining.

    If I'm correct, this way you can avoid to have to authorize sp-users to the other db unless you encounter the ownership-chaining-break-problem.

    Create the sp with the common schema (user) and then grant execute to those who need it.

    For the moment I've only enabled it on my own little exclusive server.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • You may want to avoid using the guest account for several reasons... here's what the MSDN link that yoav provided warns of...

    "Avoid using the guest account; all logins without their own database permissions obtain the database permissions granted to this account."

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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