Removes a Microsoft® SQL Server™ login or a Microsoft Windows NT® user or group from a fixed server role.
sp_dropsrvrolemember [@loginame =] 'login', [@rolename =] 'role'
0 (success) or 1 (failure)
Only sp_dropsrvrolemember can be used to remove a login from a server role. Use sp_droprolemember to remove a member from a standard SQL Server role.
When a login has been removed from a server role, that login can no longer perform activities based on the permissions associated with the server role.
The sa login cannot be removed from any fixed server role.
sp_dropsrvrolemember cannot be executed from within a user-defined transaction.
Only members of the sysadmin fixed server role can execute sp_dropsrvrolemember to remove any login from a fixed server role. Members of a fixed server role can remove other members of the same fixed server role.
This example removes the login JackO from the sysadmin fixed server role.
EXEC sp_dropsrvrolemember 'JackO', 'sysadmin'
sp_addsrvrolemember | System Stored Procedures |
sp_droprolemember |