sp_addsrvrolemember - statement of language DB_MSSQL
Description:
Adds an account as a fixed role member of the SQL Server. Then the account gets rights connected with the appropriate fixed role in the SQL Server.
Syntax:
sp_addsrvrolemember
[ @loginame = ] 'login'
[ @rolename = ] 'role'
@loginame | Account for which an access to the current database will be enabled. |
---|
@rolename | Role of the server into which the account will be added (sysadmin, securityadmin, serveradmin, setupadmin, processadmin, diskadmin, dbcreator, bulkadmin). |
---|
Note:
The fixed role of the SQL Server holds globally in the SQL Server. The database role holds for the certain database.
Example:
Adds the account 'pm_admin' into the fixed role of the server 'sysadmin' (this account can be used for administration of the SQL Server).
EXEC sp_addsrvrolemember 'pm_admin', 'sysadmin'