• When you use EXECUTE AS for a stored procedure you impersonate a user, and when you impersonate a user you are sandboxed into the current database. There are ways to open the sandbox, but they can lead to security holes. A much better strategy is to use certificate signing. This permits you to assign permissions to stored procedure much more granually, and you don't run into all the side effects with EXECUTE AS.

    In this article on my web site, I discuss both certificate signing and impersonation in detail: http://www.sommarskog.se/grantperm.html.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]