共用方式為


ReplicationServer.CopySubscriptionDatabase Method

Copies an existing pull subscription database.

命名空間: Microsoft.SqlServer.Replication
組件: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)

語法

'宣告
Public Sub CopySubscriptionDatabase ( _
    databaseName As String, _
    fileName As String, _
    overwriteExistingFile As Boolean _
)
public void CopySubscriptionDatabase (
    string databaseName,
    string fileName,
    bool overwriteExistingFile
)
public:
void CopySubscriptionDatabase (
    String^ databaseName, 
    String^ fileName, 
    bool overwriteExistingFile
)
public void CopySubscriptionDatabase (
    String databaseName, 
    String fileName, 
    boolean overwriteExistingFile
)
public function CopySubscriptionDatabase (
    databaseName : String, 
    fileName : String, 
    overwriteExistingFile : boolean
)

參數

  • databaseName
    A string value that specifies the name of a pull subscription database to copy.
  • fileName
    A string value that specifies the complete path, including file name, to which a copy of the data portion (.mdf) file is saved.
  • overwriteExistingFile
    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.

例外

例外類型 狀況
ApplicationException

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

ArgumentException

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

備註

This feature has been deprecated.

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.

This method is only available with instances of SQL Server 2000 and SQL Server 2005.

This namespace, class, or member is supported only in version 2.0 of the .NET Framework.

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

ReplicationServer Class
ReplicationServer Members
Microsoft.SqlServer.Replication Namespace

其他資源

CopySubscription Method (Replication ActiveX)
可附加訂閱