TransPullSubscription Object
未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。
The TransPullSubscription object represents a Subscriber-originated pull or an anonymous subscription to a transactional or snapshot publication.
Properties
SubscriberType Property (TransPullSubscription, TransSubscription) |
|
Methods
備註
With the TransPullSubscription object, you can:
- Add a pull or anonymous subscription to a transactional publication.
- Change the properties of an existing pull or anonymous subscription to a transactional publication.
- Add a pull or anonymous subscription to a snapshot publication.
- Change the properties of an existing pull or anonymous subscription to a snapshot publication.
附註: |
---|
The TransPullSubscription object is compatible with instances of SQL Server 2000 and SQL Server version 7.0. However, the TransPullSubscription2 object extends the functionality of the TransPullSubscription object for use with features that are new in SQL Server 2000. |
To create a transactional pull subscription at the Subscriber
Create a new TransPullSubscription object.
Set the Publisher property to the name of an existing Publisher.
Set the Distributor property to the name of the Distributor.
Set the PublicationDB property to the name of the database (at the Publisher) where the publication is located.
Set the Publication property to the name of the publication to which to subscribe.
Set the SubscriptionType property to SQLDMOSubscription_Pull.
Set the SecurityMode property of the DistributorSecurity object property as appropriate.
If the SecurityMode property of the DistributorSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the DistributorSecurity object property.
Set the SecurityMode property of the PublisherSecurity object property as appropriate.
If the SecurityMode property of the PublisherSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the PublisherSecurity object property.
Note that the Name property defaults to publisher**:publication_database:**publication.
Add the TransPullSubscription object to the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Get a ReplicationDatabase object that contains the publication from the ReplicationDatabases collection of a Replication object connected to the Publisher.
Use the EnableTransSubscription method of the ReplicationDatabase object that is connected to the Publisher.
To create a transactional anonymous subscription at the Subscriber
Create a new TransPullSubscription object.
Set the Publisher property to the name of an existing Publisher.
Set the PublicationDB property to the name of the database (at the Publisher) where the publication is located.
Set the Publication property to the name of the publication to which to subscribe.
Set the SubscriptionType property to SQLDMOSubscription_Anonymous.
Set the SecurityMode property of the DistributorSecurity object property as appropriate.
If the SecurityMode property of the DistributorSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the DistributorSecurity object property.
Set the SecurityMode property of the PublisherSecurity object property as appropriate.
If the SecurityMode property of the PublisherSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the PublisherSecurity object property.
Note that the Name property defaults to publisher**:publication_database:**publication.
Add the TransPullSubscription object to the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
To alter an existing transactional pull subscription at the Subscriber
Get a TransPullSubscription object from the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Use the BeginAlter method to mark the beginning of the changes.
Set the TransPullSubscription object properties to reflect the changes to the transactional pull subscription.
Use the DoAlter method to submit the changes to Microsoft® SQL Server™.
To alter an existing transactional anonymous subscription at the Subscriber
Get a TransPullSubscription object containing a transactional anonymous subscription from the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Use the BeginAlter method to mark the beginning of the changes.
Set the TransPullSubscription object properties to reflect the changes to the transactional anonymous subscription.
Use the DoAlter method to submit the changes to SQL Server.
To create a snapshot pull subscription at the Subscriber
Create a new TransPullSubscription object.
Set the Publisher property to the name of an existing Publisher.
Set the PublicationDB property to the name of the database (at the Publisher) where the snapshot publication is located.
Set the Publication property to the name of the snapshot publication to which to subscribe.
Set the SubscriptionType property to SQLDMOSubscription_Pull.
Set the SecurityMode property of the DistributorSecurity object property as appropriate.
If the SecurityMode property of the DistributorSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the DistributorSecurity object property.
Set the SecurityMode property of the PublisherSecurity object property as appropriate.
If the SecurityMode property of the PublisherSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the PublisherSecurity object property.
Note that the Name property defaults to publisher**:publication_database:**publication.
Add the TransPullSubscription object to the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Get a ReplicationDatabase object that contains the publication from the ReplicationDatabases collection of a Replication object connected to the Publisher.
Use the EnableTransSubscription method of the ReplicationDatabase object connected to the Publisher.Use the DoAlter method to submit the changes to SQL Server.
To create a snapshot anonymous subscription at the Subscriber
Create a new TransPullSubscription object.
Set the Publisher property to the name of an existing Publisher.
Set the PublicationDB property to the name of the database (at the Publisher) where the snapshot publication is located.
Set the Publication property to the name of the snapshot publication to subscribe to.
Set the SubscriptionType property to SQLDMOSubscription_Anonymous.
Set the SecurityMode property of the DistributorSecurity object property as appropriate.
If the SecurityMode property of the DistributorSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the DistributorSecurity object property.
Set the SecurityMode property of the PublisherSecurity object property as appropriate.
If the SecurityMode property of the PublisherSecurity object property is set to SQLDMOReplSecurity_Normal, set the StandardLogin and StandardPassword properties of the PublisherSecurity object property.
Note that the Name property defaults to publisher**:publication_database:**publication.
Add the TransPullSubscription object to the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
To alter an existing snapshot pull subscription at the Subscriber
Get a TransPullSubscription object containing a snapshot pull subscription from the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Use the BeginAlter method to mark the beginning of the changes.
Set the TransPullSubscription object properties to reflect the changes to the snapshot pull subscription.
Use the DoAlter method to submit the changes to SQL Server.
To alter an existing snapshot anonymous subscription at the Subscriber
Get a TransPullSubscription object containing a snapshot anonymous subscription from the TransPullSubscriptions collection of a connected ReplicationDatabase object at the Subscriber.
Use the BeginAlter method to mark the beginning of the changes.
Set the TransPullSubscription object properties to reflect the changes to the snapshot anonymous subscription.
Use the DoAlter method to submit the changes to SQL Server.