Removes an alias that links a user in the current database to a SQL Server login.
sp_dropalias provides compatibility with earlier versions of SQL Server. This feature will be removed in the next version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible. SQL Server provides roles and the ability to grant permissions to roles as an alternative to using aliases.
Applies to: SQL Server (SQL Server 2008 through current version).
Aliases enable 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 whose alias the login assumed in the current database.
sp_dropalias cannot be executed within a user-defined transaction.
The following example removes the alias to SQL Server login Victoria from the current database.
EXEC sp_dropalias 'Victoria';