Removes an application role from the current database.
sp_dropapprole [@rolename =] 'role'
[@rolename =] 'role'
Is the application role to remove. role is sysname, with no default. role must exist in the current database.
Return Code Values
0 (success) or 1 (failure)
sp_dropapprole can only be used to remove application roles. Use sp_droprole to remove a standard Microsoft® SQL Server™ role. An application role cannot be removed if it owns any objects. Either remove the objects before removing the application role, or use sp_changeobjectowner to change the owner of any objects that must not be removed.
sp_dropapprole cannot be executed within a user-defined transaction.
Only members of the sysadmin fixed server role, the db_securityadmin and db_owner fixed database roles can execute sp_dropapprole.
This example removes the SalesApp application role from the current database.
EXEC sp_dropapprole 'SalesApp'