Condividi tramite


AddMember Method

Questa funzionalità verrà rimossa in una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The AddMember method assigns Microsoft SQL Server database or server role membership to the specified user, database role, or login.

Sintassi

object
.AddMember(
User
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • User
    For the DatabaseRole object, a string that specifies an existing database user or role by name. For the ServerRole object, a string that specifies an existing SQL Server login by name.

Prototype (C/C++)

HRESULT AddMember(SQLDMO_LPCSTR NewValue);

Osservazioni

Configuring role membership by using the AddMember method of the Database and ServerRole objects requires appropriate permissions.

For the Database object, the database user mapped to the SQL Server login used for SQLServer object connection must be a member of the fixed database role db_owner.

For the ServerRole object, the SQL Server login used for SQLServer object connection must be a member of the role to which the specified login will be added.

Applies to:

DatabaseRole Object

ServerRole Object