Impersonate with EXECUTE AS… Statement

In SQL 2005 and above, a statement can be executed in context of another user:

EXECUTE AS User = ‘username
[statements]
REVERT

Requires IMPERSONATE permissions on the login or username impersonated. This permission is implied for sysadmin for all databases, and db_owner role members in databases that they own.

Advertisements
Impersonate with EXECUTE AS… Statement