sp_dropuser

Description

Drops a user from the current database.

Syntax

sp_dropuser name_in_db

Parameters

name_in_db

is the user’s name in the current database’s sysusers table.

Examples

Example 1

Drops the user “albert” from the current database. The user “albert” can no longer use the database:

sp_dropuser albert

Usage

Permissions

Only the Database Owner, a System Administrator, or a System Security Officer can execute sp_dropuser.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Commands grant, revoke, use

System procedures sp_addalias, sp_adduser, sp_bindexeclass, sp_droplogin