Adds a login as a member of a fixed server role.
sp_addsrvrolemember [@loginame =] 'login', [@rolename =] 'role'
0 (success) or 1 (failure)
When a login is added to a fixed server role, the login gains the permissions associated with that fixed server role.
The role membership of the sa login cannot be changed.
Use sp_addrolemember to add a member to a fixed database or user-defined role.
sp_addsrvrolemember stored procedure cannot be executed within a user-defined transaction.
Members of a fixed server role can execute sp_addsrvrolemember to add members only to the same fixed server role.
This example adds the Windows NT user Corporate\HelenS to the sysadmin fixed server role.
EXEC sp_addsrvrolemember 'Corporate\HelenS', 'sysadmin'
sp_addrolemember | System Stored Procedures |
sp_dropsrvrolemember |