REVERT
ends EXECUTE AS
What changes
- Input
- none
- Output or change
- session security context
Syntax at a glance
REVERT [ WITH COOKIE = @varbinary_variable ]
Work example
A session must return from an impersonated context to its prior principal.
Pair each execution-context change with its expected revert point and error path.
Check your work The effective principal after revert matches the original session identity.
Open Microsoft Learn for full syntax, permissions, and details for your version.