Execution Context and the EXECUTE AS Clause

In order to execute a stored procedure created by another user, the user executing the procedure must be granted execute permission on the procedure. By default, however, permissions on objects referenced within the stored procedure are not automatically inherited from the procedure owner if the objects referenced within the stored procedure are not also owned by the creator of the stored procedure. The current user executing the procedure must also have the necessary permissions granted on the referenced objects in order to successfully execute the procedure. The only exception to this occurs when the objects referenced by a stored procedure are also owned by the same user who owns the stored procedure. ...

Get Microsoft SQL Server 2014 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.