Поделиться через


Метод ReplicationServer.AttachSubscriptionDatabase

Attaches a copied subscription database at the Subscriber.

Пространство имен:  Microsoft.SqlServer.Replication
Сборка:  Microsoft.SqlServer.Rmo (в Microsoft.SqlServer.Rmo.dll)

Синтаксис

'Декларация
Public Sub AttachSubscriptionDatabase ( _
    databaseName As String, _
    fileName As String, _
    subscriberSecurity As ConnectionSecurityContext _
)
'Применение
Dim instance As ReplicationServer 
Dim databaseName As String 
Dim fileName As String 
Dim subscriberSecurity As ConnectionSecurityContext

instance.AttachSubscriptionDatabase(databaseName, _
    fileName, subscriberSecurity)
public void AttachSubscriptionDatabase(
    string databaseName,
    string fileName,
    ConnectionSecurityContext subscriberSecurity
)
public:
void AttachSubscriptionDatabase(
    String^ databaseName, 
    String^ fileName, 
    ConnectionSecurityContext^ subscriberSecurity
)
member AttachSubscriptionDatabase : 
        databaseName:string * 
        fileName:string * 
        subscriberSecurity:ConnectionSecurityContext -> unit
public function AttachSubscriptionDatabase(
    databaseName : String, 
    fileName : String, 
    subscriberSecurity : ConnectionSecurityContext
)

Параметры

  • databaseName
    Тип: System.String
    A string value that specifies the name of the database being attached.
  • fileName
    Тип: System.String
    A string value that specifies the complete path to, and the file name of, the data (.mdf) file being attached.

Исключения

Исключение Условие
ApplicationException

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

ArgumentException

If string parameters are null, contain null characters, or are too long.

If the subscriberSecurity parameter is null.

Замечания

The AttachSubscriptionDatabase method can be called by members of the sysadmin fixed server role.

The AttachSubscriptionDatabase method is equivalent to executing sp_attachsubscription (Transact-SQL).

См. также

Справочник

ReplicationServer Класс

Пространство имен Microsoft.SqlServer.Replication