Switch execution context back to the caller of the last EXECUTE AS statement.
Syntax REVERT [WITH COOKIE = @varbinary_variable] Key WITH COOKIE Cookie created in a corresponding EXECUTE AS stand-alone statement.
REVERT can be specified as a stand-alone statement or used within a stored procedure or user-defined function.
varbinary_variable is varbinary(100)
CREATE PROCEDURE dbo.Myprocedure
WITH EXECUTE AS CALLER
EXECUTE AS USER = 'service_account';
"I don't know if I believe in role models. We're all so different; we're all individuals. In the long run, that's what matters" - Wilson Cruz
Equivalent Oracle command:
ALTER SESSION SET CURRENT_SCHEMA = schema
© Copyright SS64.com 1999-2013
Some rights reserved