RegisteredSubscribers Collection
未來的 Microsoft SQL Server 版本將移除這項功能。請避免在新的開發工作中使用這項功能,並規劃修改目前使用這項功能的應用程式。
The RegisteredSubscribers collection contains RegisteredSubscriber objects that reference instances of Microsoft SQL Server maintained as registry entries. These objects are visible to replication as targets for Publisher-originated (push) subscriptions.
Methods
備註
SQL Server replication enhances the registry-maintained lists of instances of SQL Server by associating replication components, such as schedules and security, with registry-listed instances. SQL Distributed Management Objects (SQL-DMO) makes this association visible through the RegisteredSubscriber object and RegisteredSubscribers collection.
For more information about registry-maintained lists of instances of SQL Server, see RegisteredServer Object.
With the RegisteredSubscribers collection, you can:
Configure a registered instance of SQL Server for push subscription by associating replication schedules and security with the named instance.
Remove replication schedules and security for an instance of SQL Server registered and configured for push subscription, disabling push subscription to the instance.
Generate Transact-SQL script that can be used as part of replication administration, such as a script re-creating configuration parameters for all instances of SQL Server.
For more information about configuring push-subscription capable instances using the RegisteredSubscriber object and RegisteredSubscribers collection, see RegisteredSubscriber Object.
To disable a push subscription to a registered instance
Get the appropriate RegisteredSubscribers collection. When disabling a subscription at the Publisher of the data, use the RegisteredSubscribers collection of the Publisher object that references the publishing instance. When disabling a subscription at the Distributor of the data, use the RegisteredSubscribers collection of the DistributionPublisher object referencing the source of the published data.
Use the Remove method of the RegisteredSubscribers collection.
When using the Item or Remove method, the RegisteredSubscribers collection supports member identification using either name or ordinal reference syntax. For example:
Set oRegisteredSubscriber = oPublisher.RegisteredSubscribers("LONDON2")
Or:
Set oRegisteredSubscriber = oPublisher.RegisteredSubscribers(2)