Condividi tramite


WriteReplicationFailOverMode Method

Questa funzionalità verrà rimossa in una delle prossime versioni di Microsoft SQL Server. Evitare di utilizzare questa funzionalità in un nuovo progetto di sviluppo e prevedere interventi di modifica nelle applicazioni in cui è attualmente implementata.

The WriteReplicationFailOverMode method sets the failover mode for a subscription that uses immediate updating with queued updating as a failover option.

Sintassi

object
.WriteReplicationFailOverMode(
szPublisher , 
szPublicationDB , 
szPublication ,
FailOverMode)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • szPublisher
    String that specifies the name of the Publisher.
  • szPublicationDB
    String that specifies the name of the publication database.
  • szPublication
    String that specifies the name of the publication.
  • FailOverMode
    Long integer specifying a SQLDMO_REPLFAILOVER_TYPE constant as described in Settings.

Prototype (C/C++)

HRESULT WriteReplicationFailOverMode(
SQLDMO_LPCSTR pszPublisher, 
SQLDMO_LPCSTR pszPublicationDB, 
SQLDMO_LPCSTR pszPublication, 
SQLDMO_REPLFAILOVER_TYPE FailOverMode);

Settings

Set the FailOverMode parameter using these values.

Constant Value Description

SQLDMOReplFailOver_/Immediate

0

Use the immediate updating option to propagate changes made at Subscribers to the Publisher.

SQLDMOReplFailOver_/Queued

1

Use the queued updating option to propagate changes made at Subscribers to the Publisher.

Osservazioni

Microsoft SQL Server replication supports toggling between immediate updating and queued updating options. This configuration is also known as immediate updating with queued updating as a failover option. You can invoke failover, or queued updating, when an immediate update on the Subscriber fails because the Publisher is not available. At some later point, when the Publisher becomes available, you can invoke failback, or immediate updating. Set the FailOverMode parameter to SQLDMOReplFailOver_Queued to enable queued updating.

Prior to using WriteReplicationFailOverMode, ensure that the subscription was created using a SQLDMO_TRANSUBSCRIBER_TYPE value of SQLDMOTranSubscriber_Failover.

[!NOTA] If an application calls WriteReplicationFailOverMode on an instance of SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000 or later" are returned.

Applies To:

ReplicationDatabase2 Object

 

Vedere anche

Riferimento

ReadReplicationFailOverMode Method

Guida in linea e informazioni

Assistenza su SQL Server 2005