次の方法で共有


TransPublication Object

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

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

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

Properties

AllowSynchronousTransactions Property

PublicationAttributes Property

AutogenerateSyncProcedures Property

ReplicationFrequency Property

Enabled Property

RetentionPeriod Property

HasSubscription Property

SnapshotAvailable Property

ID Property

SnapshotJobID Property

Name Property

SnapshotMethod Property

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)

解説

With the TransPublication object, you can:

  • Create a transactional publication.
  • Change the properties of an existing transactional publication.
  • Enable a transactional publication after all articles are added.
  • Create a snapshot publication.
  • Change the properties of an existing snapshot publication.
  • Enable a snapshot publication after all articles are added.
ms133996.note(ja-jp,SQL.90).gifメモ :
The TransPublication object is compatible with instances of SQL Server versions 7.0 and later. However, the TransPublication2 object extends the functionality of the TransPublication object for use with features that were introduced in SQL Server 2000.

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.

    • To enable push subscriptions, use SQLDMOPubAttrib_AllowPush.
    • To enable pull subscriptions, use SQLDMOPubAttrib_AllowPull.
    • To enable anonymous subscriptions, use SQLDMOPubAttrib_AllowPull, SQLDMOPubAttrib_AllowAnonymous, and SQLDMOPubAttrib_ImmediateSync.
    • To enable Internet subscriptions, use SQLDMOPubAttrib_InternetEnabled.
  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.

    • To enable push subscriptions, use SQLDMOPubAttrib_AllowPush.
    • To enable pull subscriptions, use SQLDMOPubAttrib_AllowPull.
    • To enable anonymous subscriptions, use SQLDMOPubAttrib_AllowPull, SQLDMOPubAttrib_AllowAnonymous, and SQLDMOPubAttrib_ImmediateSync.
    • To enable Internet subscriptions, use SQLDMOPubAttrib_InternetEnabled.
  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 snapshot 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.

参照

関連項目

TransPublication2 Object

ヘルプおよび情報

SQL Server 2005 の参考資料の入手