Stored procedure with EXECUTE AS

  • I have a procedure that calls the EXECUTE AS and I want to create this SP in different databases. What is a intelligent approach to create the SP? Basically I need to create it in several databases however I can't create it in only one database and then call it using the 3 naming convention. Because it won't work when the stored procedure is using the EXECUTE AS.

    I only can think about this:

    Use XXX

    GO

    Create proc sproc

    GO

    Use YYY

    GO

    Create proc sproc

    GO

    Use ZZZ

    GO

    Create proc sproc

    GO

  • I’m not very clear on the question but I believe u need to create the impersonated user in the new databases

    Just a quick question, You mentioned that you intend to create this same procedure in different Databases. Are the new databases subscribers to some replication topology?

  • no replication involved.

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

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