sp_addalias

Description

Allows an Adaptive Server user to be known in a database as another user.

Syntax

sp_addalias loginame, name_in_db

Parameters

loginame

is the master.dbo.syslogins name of the user who wants an alternate identity in the current database.

name_in_db

is the database user name to alias loginame to. The name must exist in both master.dbo.syslogins and in the sysusers table of the current database.

Examples

Example 1

There is a user named “albert” in the database’s sysusers table and a login for a user named “victoria” in master.dbo.syslogins. This command allows “victoria” to use the current database by assuming the name “albert”:

sp_addalias victoria, albert

Usage

Permissions

Only the Database Owner or a System Administrator can execute sp_addalias.

See also

Command use

System procedures sp_addlogin, sp_adduser, sp_dropalias, sp_helpuser