O'Reilly logo

Microsoft® SQL Server 2012 Unleashed by Alex T. Silverstein, Chris Gallelli, Paul T. Bertucci, Ray Rankins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implicit Context Switching

With implicit context switching, the execution context is set within a module such as a stored procedure, trigger, or user-defined function. The EXECUTE AS clause is placed in the module and is set to the user that the module will be run as. The context switch is implicit because the user who runs the module does not have to explicitly specify the context before running the module. The context is set within the module.

The EXECUTE AS clause has several different options to establish the execution context. All modules are able to set the context to a specific user or login. Functions, stored procedures, and Data Manipulation Language (DML) triggers can also execute as CALLER, SELF, or OWNER. DDL triggers can run as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required