다음을 통해 공유


RemoteLogins Collection

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 않도록 하고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The RemoteLogin object exposes the properties of a single login mapping record for connections to an instance of Microsoft SQL Server that originates from another, known instance of SQL Server.

현재 개체를 보여 주는 SQL-DMO 개체 모델

Properties

주의

An instance of SQL Server can maintain authentication information for connections originating from other instances of SQL Server. Server-originated connections are attempted when, for example, remote procedure calls are part of a Transact-SQL script.

Each instance of SQL Server in an organization can control access by listing the servers it accepts connections from. For each of these remote servers, login-account mappings specify the local login used by a remote server connection when that remote server connects as part of a process run by the remote login.

With the RemoteLogins collection, you can:

  • Map a login record on an instance of SQL Server to an existing login record on another instance of SQL Server.

  • Remove a remote login record from the list of logins mapped for a remote instance of SQL Server.

To create a remote login

  1. Create a RemoteLogin object.

  2. Configure the RemoteLogin object by setting the RemoteName property to the name of a login on the remote (or connecting) instance of SQL Server.

  3. Configure the RemoteLogin object by setting the LocalName property to the name of a login on the local (or connected to) instance of SQL Server.

  4. Add the RemoteLogin object to the RemoteLogins collection of a RemoteServer object that references an existing remote server definition.

To remove a remote login

  • Use the Remove method of the RemoteLogins collection as in:

    oRemoteServer.RemoteLogins.Remove("stevenb")
    

When using the Item or Remove method, the RemoteLogins collection supports member identification using either name or ordinal reference syntax. For example:

Set oRemoteLogin = oRemoteServer.RemoteLogins("stevenb")

Or:

Set oRemoteLogin = oRemoteServer.RemoteLogins(2)

[!참고]

Creating or removing remote server login mappings by using the RemoteLogins collection requires appropriate privilege. The SQL Server login used for SQLServer object connection must be a member of the fixed role securityadmin or a role with greater privilege.