次の方法で共有


TransPublications Collection

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

The TransPublications collection contains TransPublication objects that reference Microsoft SQL Server transactional and snapshot replication publications.

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

Properties

Count Property

 

Methods

Add Method

Script Method (Replication Objects)

Item Method

Refresh Method

ItemByID Method

Remove Method (Collections)

解説

With the TransPublications object, you can:

  • Create a transactional or snapshot replication publication.
  • Generate a Transact-SQL script that can be used as part of the administration of all transactional or snapshot publications defined on an instance of SQL Server.
  • Remove a transactional or snapshot replication publication.

To remove a transactional or snapshot replication publication

  1. Get a TransPublication object from the TransPublications collection of a connected ReplicationDatabase object.

  2. For each TransSubscription object in the TransSubscriptions collection, test the SubscriptionType property. If the SubscriptionType property value for all referenced subscriptions is SQLDMOSubscription_Push, you can safely remove the referenced transactional or snapshot replication publication. If pull subscriptions are defined on the publication, take appropriate action to disable the pull subscription at the Subscriber prior to removing the publication.

  3. Use the Remove method of the TransPublication object to remove the referenced publication.

    ms142532.note(ja-jp,SQL.90).gifメモ :
    Removing a publication by using the Remove method of a TransPublication or MergePublication object removes all article definitions and all known subscription entries. Removing a publication does not remove a replicated copy of the publication articles at any Subscriber.

When using the Item or Remove method, the TransPublications collection supports member identification using either name or ordinal reference syntax. For example:

Set oTransPublication = 
oReplicationDatabase.TransPublications("[Northwind_Snap]")

Or:

Set oTransPublication = oReplicationDatabase.TransPublications(7)