次の方法で共有


CopySubscriptionDatabase Method

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

The CopySubscriptionDatabase method copies a subscription database that has pull subscriptions, but no push subscriptions. Only single file databases can be copied.

構文

object
.CopySubscriptionDatabase(
szFileName
,
[
fOverWriteExistingFile
]
)

Parts

  • Object
    Expression that evaluates to an object in the Applies To list.
  • szFileName
    String that specifies the complete path, including file name, to which a copy of the data portion (.mdf) file is saved.
  • fOverWriteExistingFile
    Optional Boolean that specifies whether to overwrite an existing file of the same name specified in the szFileName parameter. The default is FALSE.

Prototype (C/C++)

HRESULT CopySubscriptionDatabase(
SQLDMO_LPCSTR pszFilename,
BOOL fOverWriteExistingFile);

解説

You can use CopySubscriptionDatabase to copy a subscription database to a file as an alternative to applying a snapshot at the Subscriber. The database must be configured to support only pull subscriptions. Users having appropriate permissions can make copies of the subscription database and then e-mail, copy, or transport the subscription file (.msf) to another Subscriber, where it can then be attached as a subscription.

This technique is useful for copying highly customized databases that contain user-defined objects, such as triggers, stored procedures, and views.

To copy a subscription database

  1. Use the CopySubscriptionDatabase method to copy the subscription database as an .msf file.

  2. Use the AttachSubscriptionDatabase method to attach the .msf file to the Subscriber.

    ms141862.note(ja-jp,SQL.90).gifメモ :
    If an application calls CopySubscriptionDatabase on an instance of SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000" are returned.

Applies to:

ReplicationDatabase2 Object

参照

関連項目

AttachSubscriptionDatabase Method

ヘルプおよび情報

SQL Server 2005 の参考資料の入手