共用方式為


ReplicationServer.CopySubscriptionDatabase(String, String, Boolean) Method

Definition

Copies an existing pull subscription database.

public:
 void CopySubscriptionDatabase(System::String ^ databaseName, System::String ^ fileName, bool overwriteExistingFile);
public void CopySubscriptionDatabase (string databaseName, string fileName, bool overwriteExistingFile);
member this.CopySubscriptionDatabase : string * string * bool -> unit
Public Sub CopySubscriptionDatabase (databaseName As String, fileName As String, overwriteExistingFile As Boolean)

Parameters

databaseName
String

A string value that specifies the name of a pull subscription database to copy.

fileName
String

A string value that specifies the complete path, including file name, to which a copy of the data portion (.mdf) file is saved.

overwriteExistingFile
Boolean

A Boolean value that specifies whether or not to overwrite an existing file of the same name specified in the fileName parameter, if there is one.

Exceptions

When the server is not running on Microsoft SQL Server 2000 or later.

If a parameter is null, contains null characters, or exceeds 128 bytes.

Remarks

Note

This feature will be removed in a future version of Microsoft SQL Server. Do not use this feature in new development work, and modify applications that currently use this feature as soon as possible.

Only single file databases can be copied.

The CopySubscriptionDatabase method can be called by a member of the db_owner fixed database role of the database that is being copied.

The CopySubscriptionDatabase method is equivalent to the sp_copysubscription (Transact-SQL) stored procedure.

Applies to