Removes an alias to a user in the current database from a login. sp_dropalias is provided for backward compatibility only. Use roles and the sp_droprolemember stored procedure instead of aliases.
sp_dropalias [@loginame =] 'login'
0 (success) or 1 (failure)
Aliases allow logins to assume the identity of a user in a database, thereby gaining the permissions of that user while working in that database.
When the alias is removed, the login can no longer perform the activities associated with the user to whom they were aliased in the current database.
sp_dropalias cannot be executed within a user-defined transaction.
Only members of the db_accessadmin or db_owner fixed database roles can execute sp_dropalias.
This example removes the alias to user Victoria in the current database.
EXEC sp_dropalias 'Victoria'
sp_addalias | sp_droprolemember |
sp_addrolemember | System Stored Procedures |