次の方法で共有


RegisteredServer Object

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The RegisteredServer object exposes the attributes of a single, registry-listed instance of Microsoft SQL Server.

現在のオブジェクトを表す SQL-DMO オブジェクト モデル

Properties

Login Property

SaLogin Property

Name Property

UseTrustedConnection Property

Password Property

VersionMajor Property

PersistFlags Property

VersionMinor Property

Methods

Remove Method (Objects)

解説

SQL Distributed Management Objects (SQL-DMO) applications can maintain lists of some or all instances of SQL Server in an organization in the registry of the operating system. The lists establish categories for instances of SQL Server.

For example, to group and view servers by division in a SQL-DMO application, SQL-DMO would represent each division as a ServerGroup object. The division's ServerGroup name is maintained by SQL-DMO as a Windows registry key. Within this registry entry, separate keys list each instance of SQL Server in the division. The list of these keys forms the members of the SQL-DMO RegisteredServers collection, while each key's data is exposed by a RegisteredServer object.

With the RegisteredServer object, you can:

  • Create a Windows registry entry that lists an organization server.
  • Remove a Windows registry entry that lists an instance of SQL Server.
  • Manage a Windows registry entry that lists an instance of SQL Server by setting connection-validation attributes.

The Name property of the RegisteredServer object refers to the instance of SQL Server registered. SQL-DMO does not attempt to validate the Name property value when registering an instance of SQL Server. The RegisteredServer object Name property is validated when the object is used in an attempt to connect to an instance of SQL Server.

After an instance of SQL Server is registered, SQL-DMO uses the properties of the registered server when connecting and when attempting to reconnect after a connection failure. For example, SQL-DMO ignores the szLogin and szPassword parameters of the Connect method of the SQLServer object when that object references an instance of SQL Server registered to use Windows Authentication Mode.

To create a registry entry listing an instance of SQL Server

  1. Create a RegisteredServer object.

  2. Set the properties determining connection validation appropriately. For example, set the UseTrustedConnection property to TRUE to enable Windows Authentication Mode.

  3. Add the RegisteredServer object to the RegisteredServers collection of the ServerGroup object of an Application object.