sp_changemergefilter
Changes some merge filter properties. The merge filter properties that can be changed include filtername and join_filterclause. This stored procedure is executed at the Publisher on the publication database.
Syntax
sp_changemergefilter [ @publication = ] 'publication'
, [ @article = ] 'article'
, [ @filtername = ] 'filtername'
, [ @property = ] 'property'
, [ @value = ] 'value'
[ , [ @force_invalidate_snapshot = ] force_invalidate_snapshot ]
[ , [ @force_reinit_subscription = ] force_reinit_subscription ]
Arguments
[@publication = ] 'publication'
Is the name of the publication. publication is sysname, with no default.
[@article = ]'article'
Is the name of the article. article is sysname, with no default.
[@filtername = ] 'filtername'
Is the current name of the filter. filtername is sysname, with no default.
[@property = ] 'property'
Is the name of the property to change. property is sysname, with no default, and can be one of these values.
Value | Description |
---|---|
filtername | Name of the filter. |
join_filterclause | Filter clause. |
join_articlename | Name of the join article. |
[@value =] 'value'
Is the new value for the specified property. value is nvarchar(2000), with no default.
[@force_invalidate_snapshot = ] force_invalidate_snapshot
Acknowledges that the action taken by this stored procedure may invalidate an existing snapshot. force_invalidate_snapshot is a bit, with a default 0. 0 specifies that changes to the merge article will not cause the snapshot to be invalid. If the stored procedure detects that the change does require a new snapshot, an error will occur and no changes will be made. 1 means that changes to the merge article may cause the snapshot to be invalid, and if there are existing subscriptions that would require a new snapshot, gives permission for the existing snapshot to be marked as obsolete and a new snapshot generated.
[@force_reinit_subscription = ] force_reinit_subscription
Acknowledges that the action taken by this stored procedure may require existing subscriptions to be reinitialized. force_reinit_subscription is a bit with a default of 0. 0 specifies that changes to the merge article will not cause the subscription to be reinitialized. If the stored procedure detects that the change would require existing subscriptions to be reinitialized, an error will occur and no changes will be made. 1 means that changes to the merge article will cause existing subscriptions to be reinitialized, and gives permission for the subscription reinitialization to occur.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_changemergefilter is used in merge replication.
Changing the filter on a merge article requires the snapshot, if one exists, to be redone. This is performed by setting the @force_invalidate_snapshot to 1. Also, if there are subscriptions to this article, the subscription need to be reinitialized. This is done by setting the @force_reinit_subscription to 1.
Permissions
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_changemergefilter.