Peristiwa
31 Mac, 11 PTG - 2 Apr, 11 PTG
Acara pembelajaran SQL, Fabric dan Power BI terbesar. 31 Mac - 2 April. Gunakan kod FABINSIDER untuk menjimatkan $400.
Daftar hari iniPelayar ini tidak lagi disokong.
Naik taraf kepada Microsoft Edge untuk memanfaatkan ciri, kemas kini keselamatan dan sokongan teknikal yang terkini.
Applies to:
SQL Server
Adds a login, or security principal, as a member of a fixed server role.
Penting
This feature will be removed in a future version of SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use ALTER SERVER ROLE instead.
Transact-SQL syntax conventions
sp_addsrvrolemember
[ @loginame = ] N'loginame'
[ , [ @rolename = ] N'rolename' ]
[ ; ]
The name of the security principal being added to the fixed server role. @loginame is sysname, with no default. @loginame can be a SQL Server login or a Windows account. If the Windows account isn't already granted access to SQL Server, access is automatically granted.
The name of the fixed server role to which the security principal is being added. @rolename is sysname, with a default of NULL
, and must be one of the following values:
0
(success) or 1
(failure).
When a security principal is added to a fixed server role, it gains the permissions associated with that role.
The role membership of the sa user and public can't be changed.
Use sp_addrolemember
to add a member to a fixed database or user-defined role.
sp_addsrvrolemember
can't be executed within a user-defined transaction.
Requires membership in the role to which the new member is being added.
The following example adds the Windows account Corporate\HelenS
to the sysadmin fixed server role.
EXEC sp_addsrvrolemember 'Corporate\HelenS', 'sysadmin';
GO
Peristiwa
31 Mac, 11 PTG - 2 Apr, 11 PTG
Acara pembelajaran SQL, Fabric dan Power BI terbesar. 31 Mac - 2 April. Gunakan kod FABINSIDER untuk menjimatkan $400.
Daftar hari ini