setuser

Description

Allows a Database Owner to impersonate another user.

Syntax

setuser ["user_name"]

Examples

Example 1

The Database Owner temporarily adopts Mary’s identity in the database in order to grant Joe permissions on authors, a table owned by Mary:

setuser "mary" 
go 
grant select on authors to joe 
setuser 
go

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

setuser permission defaults to the Database Owner and is not transferable.

See also

Commands grant, revoke, use