Share via


ReplicationDatabase.WriteSubscriptionFailoverMode Method

Definition

Sets the failover mode for an updating subscription to a transactional or snapshot publication.

public:
 void WriteSubscriptionFailoverMode(System::String ^ publisher, System::String ^ publicationDB, System::String ^ publication, Microsoft::SqlServer::Replication::FailoverMode failoverMode);
public void WriteSubscriptionFailoverMode (string publisher, string publicationDB, string publication, Microsoft.SqlServer.Replication.FailoverMode failoverMode);
member this.WriteSubscriptionFailoverMode : string * string * string * Microsoft.SqlServer.Replication.FailoverMode -> unit
Public Sub WriteSubscriptionFailoverMode (publisher As String, publicationDB As String, publication As String, failoverMode As FailoverMode)

Parameters

publisher
String

A String value that specifies the Publisher.

publicationDB
String

A String value that specifies the publication database.

publication
String

A String value that specifies the publication.

failoverMode
FailoverMode

A FailoverMode object value that specifies the failover mode.

Remarks

This method is only valid for databases subscribed to publications that support updatable subscriptions. Ensure that the AllowSyncToAlternate and AllowQueuedTransactions fields are enabled on the Attributes property for the TransPublication object to which this subscription belongs.

The <xref:Microsoft.SqlServer.Replication.ReplicationDatabase.WriteSubscriptionFailOverMode%2A> method can only be called by members of the sysadmin fixed server role and members of the db_owner fixed database role.

Calling <xref:Microsoft.SqlServer.Replication.ReplicationDatabase.WriteSubscriptionFailOverMode%2A> is equivalent to executing sp_setreplfailovermode (Transact-SQL).

Applies to