ReInitializeAllSubscriptions2 Method

SQL-DMO

SQL-DMO

ReInitializeAllSubscriptions2 Method

The ReInitializeAllSubscriptions2 method marks all subscriptions for reinitialization.

Applies To
MergePublication2 Object
Syntax

object.ReInitializeAllSubscriptions2( [ bUploadFirst ] )

Parts

object

Expression that evaluates to an object in the Applies To list

bUploadFirst

Optional Boolean that specifies whether to upload all changes from the Subscriber prior to applying the updated snapshot files when reinitializing all subscriptions to a publication.

Prototype (C/C++)

HRESULT ReInitializeAllSubscriptions2(BOOL bUploadFirst);

Remarks

Call ReInitializeAllSubscriptions2 with bUploadFirst set to TRUE to reinitialize all merge subscriptions to a publication, thereby preserving any changes made at the Subscriber since the last synchronization. This optional syntax directs the Merge Agent to upload all changes from the Subscriber before applying the updated snapshot files when processing the reinitialize request. bUploadFirst is set to FALSE by default.

Reinitializing subscriptions to a publication by using the ReInitializeAllSubscriptions2 method requires appropriate permissions. The login used for the SQLServer object connection must be a member of the sysadmin fixed server role or the db_owner fixed database role in the database referenced by the publication.

Note  If an application calls ReInitializeAllSubscriptions2 on an instance of SQL Server version 7.0 and bUploadFirst is set to TRUE, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000" are returned. ReInitializeAllSubscriptions2 can be used with Microsoft® SQL Server™ 2000 and SQL Server 7.0 if bUploadFirst is set to FALSE.