ValidateSubscriberInfo Property

SQL-DMO

SQL-DMO

ValidateSubscriberInfo Property

The ValidateSubscriberInfo property is a selectable expression containing any dynamic filtering functions, which might have the wrong value if the Merge Agent is started with the wrong parameter set.

Applies To
MergePublication2 Object
Syntax

object.ValidateSubscriberInfo [= value]

Parts

object

Expression that evaluates to an object in the Applies To list

value

String used to validate Subscriber information in a dynamic filter

Data Type

String

Modifiable

Read/write

Prototype (C/C++)

HRESULT GetValidateSubscriberInfo(SQLDMO_LPBSTR pRetVal);

HRESULT SetValidateSubscriberInfo(SQLDMO_LPCSTR NewValue);

Remarks

When a publication uses a function that references Subscriber information in a dynamic filter, SQL Server can validate Subscriber information based on that function before each merge. This ensures that information is partitioned consistently with each merge. For example, when a publication is dynamically filtered using the SUSER_SNAME function, the Merge Agent applies the initial snapshot to each Subscriber based on the Subscriber information retrieved by SUSER_SNAME.

When the Subscriber reconnects to the Publisher for synchronization, the Merge Agent validates the information at the Subscriber and ensures that the same partitions are synchronized as were originally sent. If the Merge Agent is unable to validate the same Subscriber information, the merge fails. Because the value of the function used in the dynamic filter has changed at the Subscriber, the subscription at the Subscriber must be reinitialized.

If a dynamic filtering publication uses functions such as host_name(), or suser_sname when filtering data, then Merge Agent cannot run if the Subscriber has different parameters. If the publication is created using the @validate_subscriber_info parameter of sp_addmergepublication, a validation expression (for example, host_name() or host_name() + '::' + suser_sname()) can be specified.

The expression is evaluated at the Publisher, and the value is stored at the Subscriber. Each time the Merge Agent runs, it validates that either the expression still evaluates to the same value that is stored at the Subscriber, or that the Subscription has been marked for re-initialization. A new value can be stored at the Subscriber by reinitializing the subscription.

Note  If an application calls ValidateSubscriberInfo 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" are returned.