Allows an SAP ASE user to be known in a database as another user.
sp_addalias loginame, name_in_db
sp_addalias victoria, albert
Executing sp_addalias maps one user to another in the current database. The mapping is shown in sysalternates, where the two users’ suids (system user IDs) are connected.
A user can be aliased to only one database user at a time.
A report on any users mapped to a specified user can be generated with sp_helpuser, giving the specified user’s name as an argument.
When a user tries to use a database, the SAP ASE server checks sysusers to confirm that the user is listed there. If the user is not listed there, the SAP ASE server then checks sysalternates. If the user’s suid is listed in sysalternates, mapped to a database user’s suid, the SAP ASE server treats the first user as the second user while using the database.
If the user named in loginame is in the database’s sysusers table, the SAP ASE server does not use the user’s alias identity, because it checks sysusers and finds the loginame before checking sysalternates, where the alias is listed.
See also use in Reference Manual: Commands.
The permission checks for sp_addalias differ based on your granular permissions settings.
Setting | Description |
---|---|
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 sa_role, or a user with sso_role. |
Values in event and extrainfo columns from the sysaudits table are:
Information | Values |
---|---|
Event | 38 |
Audit option | exec_procedure |
Command or access audited | Execution of a procedure |
Information in extrainfo |
|