ReplicationDatabase.WriteSubscriptionFailoverMode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- 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).