sp_dropalias

Removes the alias user name identity established with sp_addalias.

Syntax

sp_dropalias loginame [, force]

Parameters

Examples

Usage

Executing the sp_dropalias procedure deletes an alternate suid mapping for a user from the sysalternates table.

When a user’s alias is dropped, he or she no longer has access to the database for which the alias was created.

You can drop the alias of a user who owns objects in the database. You do not need to first drop the objects before dropping the login.

Permissions

The permission checks for sp_dropalias differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must be a user with manage any user privilege.

Disabled

With granular permissions disabled, you must be the database owner, a user with sso_role, or a user with sa_role.

Auditing

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

InformationValues
Event

38

Audit option

exec_procedure

Command or access audited

Execution of a procedure

Information in extrainfo
  • 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

Related reference
sp_addalias
sp_adduser
sp_droplogin
sp_dropuser
sp_helpuser