Метод CopySubscriptionDatabase
Copies an existing pull subscription database.
Пространство имен: Microsoft.SqlServer.Replication
Сборка: Microsoft.SqlServer.Rmo (в Microsoft.SqlServer.Rmo.dll)
Синтаксис
'Декларация
Public Sub CopySubscriptionDatabase ( _
databaseName As String, _
fileName As String, _
overwriteExistingFile As Boolean _
)
'Применение
Dim instance As ReplicationServer
Dim databaseName As String
Dim fileName As String
Dim overwriteExistingFile As Boolean
instance.CopySubscriptionDatabase(databaseName, _
fileName, overwriteExistingFile)
public void CopySubscriptionDatabase(
string databaseName,
string fileName,
bool overwriteExistingFile
)
public:
void CopySubscriptionDatabase(
String^ databaseName,
String^ fileName,
bool overwriteExistingFile
)
member CopySubscriptionDatabase :
databaseName:string *
fileName:string *
overwriteExistingFile:bool -> unit
public function CopySubscriptionDatabase(
databaseName : String,
fileName : String,
overwriteExistingFile : boolean
)
Параметры
- databaseName
Тип System. . :: . .String
A string value that specifies the name of a pull subscription database to copy.
- fileName
Тип System. . :: . .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
Тип System. . :: . .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.
Исключения
Исключение | Условие |
---|---|
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. |
Замечания
Примечание |
---|
В будущей версии Microsoft SQL Server эта возможность будет удалена. Не используйте ее при работе над новыми приложениями и как можно быстрее измените приложения, в которых она в настоящее время используется. |
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.