Stored Procedures that access two separate databases

  • We do not allow dynamic sql on our servers. All SQL is done through stored procedures. The problem I have now is a stored procedure that needs to access data from different databases.

    The procedure has been written and the login has been granted execute permissions to the stored procedure. We get errors saying the login does not have 'select' permission on the second database.

    Any ideas how to get around this?

  • Cross database access requires that the user also have rights in the other database.

  • Kim Talley (11/10/2008)


    We do not allow dynamic sql on our servers. All SQL is done through stored procedures. The problem I have now is a stored procedure that needs to access data from different databases.

    The procedure has been written and the login has been granted execute permissions to the stored procedure. We get errors saying the login does not have 'select' permission on the second database.

    Any ideas how to get around this?

    cannot we create a linked server on the same server but with the different datbaase credentials to link the different databases

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

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

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