sp_addmergefilter (T-SQL)
Adds a new merge filter for the purpose of creating a partition based on a join with another table.
Syntax
sp_ addmergefilter [@publication =] 'publication',
[@article =] 'article', [@filtername =] 'filtername',
[@join_articlename =] 'join_articlename'
[,[@join_filterclause =] join_filterclause]
[,[@join_unique_key =] join_unique_key]
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 name of the filter. filtername is a required parameter. filtername is sysname, with no default.
- [@join_articlename =] 'join_articlename'
- Is the article name of the join table. join_articlename is nvarchar(258), with no default. The article must be in the publication given by publication.
- [@join_filterclause =] join_filterclause
- Is the filter clause qualifying the join. join_ filterclause is nvarchar(2000), with a default of an empty string. join_filterclause defines only Boolean filters in this stored procedure.
- [@join_unique_key =] join_unique_key
- Is whether the join is on a unique key. join_unique_key is int, with a default of 0. 0 indicates a nonunique key. 1 indicates a unique key in @join_articlename.
Return Code Values
0 (success) or 1 (failure)
Remarks
sp_addmergefilter is used in merge replication.
This option is commonly used for an article that has a foreign key reference to a published primary key table, and the primary key table has a filter defined in its article. The subset of primary key rows is used to determine the foreign key rows that are replicated to the Subscriber.
Permissions
Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_ addmergefilter.
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.