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


Метод ReplicationDatabase.LinkPublicationForUpdateableSubscription

Sets the configuration and security information used by synchronization triggers of updatable subscriptions when connecting to the Publisher.

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

Синтаксис

'Декларация
Public Sub LinkPublicationForUpdateableSubscription ( _
    publisher As String, _
    publisherDB As String, _
    publication As String, _
    distributor As String, _
    publisherSecurity As PublisherConnectionSecurityContext _
)
'Применение
Dim instance As ReplicationDatabase 
Dim publisher As String 
Dim publisherDB As String 
Dim publication As String 
Dim distributor As String 
Dim publisherSecurity As PublisherConnectionSecurityContext

instance.LinkPublicationForUpdateableSubscription(publisher, _
    publisherDB, publication, distributor, _
    publisherSecurity)
public void LinkPublicationForUpdateableSubscription(
    string publisher,
    string publisherDB,
    string publication,
    string distributor,
    PublisherConnectionSecurityContext publisherSecurity
)
public:
void LinkPublicationForUpdateableSubscription(
    String^ publisher, 
    String^ publisherDB, 
    String^ publication, 
    String^ distributor, 
    PublisherConnectionSecurityContext^ publisherSecurity
)
member LinkPublicationForUpdateableSubscription : 
        publisher:string * 
        publisherDB:string * 
        publication:string * 
        distributor:string * 
        publisherSecurity:PublisherConnectionSecurityContext -> unit
public function LinkPublicationForUpdateableSubscription(
    publisher : String, 
    publisherDB : String, 
    publication : String, 
    distributor : String, 
    publisherSecurity : PublisherConnectionSecurityContext
)

Параметры

  • publisher
    Тип: System.String
    The name of the Publisher to which the updating Subscriber connects.
  • publisherDB
    Тип: System.String
    The name of the publication database.
  • distributor
    Тип: System.String
    The name of the Distributor used by this updating Subscriber.

Исключения

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

When the version is not Microsoft SQL Server 2005 or later.

ArgumentException

When one of the String string parameters is null, contains null characters, or is longer than 128 Unicode characters.

Замечания

The LinkPublicationForUpdateableSubscription method can be called for both push and pull subscription databases. It can be called before or after the subscription is created.

The LinkPublicationForUpdateableSubscription method must only be called when the currently connected instance of SQL Server is an updatable Subscriber to a transactional publication.

The default mode used by an immediate updating Subscriber when it connects to the Publisher does not allow a connection using Windows Authentication. To connect with a mode of Windows Authentication, a linked server will have to be set up to the Publisher, and the immediate updating Subscriber should use this connection when updating the Subscriber. This requires that you specify a value of Integrated for the PublisherConnectionSecurityContext passed in the PublisherSecurity parameter when calling LinkPublicationForUpdateableSubscription.

The LinkPublicationForUpdateableSubscription method can only be called by a member of the sysadmin fixed server role at the Subscriber.

Calling LinkPublicationForUpdateableSubscription is equivalent to executing sp_link_publication (Transact-SQL).

См. также

Справочник

ReplicationDatabase Класс

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