RegisteredServer Object
この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。 新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。
The RegisteredServer object exposes the attributes of a single, registry-listed instance of Microsoft SQL Server.
Properties
説明
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
Create a RegisteredServer object.
Set the properties determining connection validation appropriately. For example, set the UseTrustedConnection property to TRUE to enable Windows Authentication Mode.
Add the RegisteredServer object to the RegisteredServers collection of the ServerGroupobject of an Application object.