TransPublication Object (SQL-DMO)

The TransPublication object represents a transactional or snapshot publication. A publication contains one or more articles (tables or stored procedures) that contain replicated data.

Remarks

With the TransPublication object, you can:

To create a transactional publication

  1. Create a new TransPublication object.
  2. Set the Name property.
  3. Note that the ReplicationFrequency property defaults to SQLDMORepFreq_Continuous, which specifies a transactional publication.
  4. Set the PublicationAttributes property as appropriate.
  5. Add the TransPublication object to the TransPublications collection of a connected ReplicationDatabase object.

To alter a transactional publication

  1. Get a TransPublication object from the TransPublications collection of a connected ReplicationDatabase object.
  2. Use the BeginAlter method to mark the beginning of the changes.
  3. Set the TransPublication object properties to reflect the changes to the transactional publication.
  4. Use the DoAlter method to submit the changes to Microsoft® SQL Server™.

To enable a transactional publication after all articles have been added

  1. Get a TransPublication object from the TransPublications collection of a connected ReplicationDatabase object.
  2. Set the Enabled property to True.

To create a snapshot publication

  1. Create a new TransPublication object.
  2. Set the Name property.
  3. Set the ReplicationFrequency property to SQLDMORepFreq_Snapshot.
  4. Set the PublicationAttributes property as appropriate.
  5. Add the TransPublication object to the TransPublications collection of a connected ReplicationDatabase object.

To alter a snapshot publication

  1. Get a TransPublication object from the TransPublications collection of a connected ReplicationDatabase object.
  2. Use the BeginAlter method to mark the beginning of the changes.
  3. Set the TransPublication object properties to reflect the changes to the snapshot publication.
  4. Use the DoAlter method to submit the changes to SQL Server.

To enable a transactional publication after all articles have been added

  1. Get a TransPublication object from the TransPublications collection of a connected ReplicationDatabase object.
  2. Set the Enabled property to True.
Methods
ActivateSubscriptions Method GrantPublicationAccess Method
BeginAlter Method RefreshChildren Method
CancelAlter Method ReInitializeAllSubscriptions Method
DoAlter Method Remove Method (Objects)
EnumPublicationAccesses Method RevokePublicationAccess Method
EnumSubscriptions Method Script Method (Replication Objects)

Properties
AllowSynchronousTransactions Property PublicationAttributes Property
AutogenerateSyncProcedures Property ReplicationFrequency Property
Description Property RetentionPeriod Property
Enabled Property SnapshotAvailable Property
HasSubscription Property SnapshotJobID Property
ID Property SnapshotMethod Property
Name Property  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.