I have merge replication with some filters. There is however one article that is used in 2 different filters so
sp_helpmergefilter for this article is returning 2 rows.
Now I want to remove both of these filters but I cannot do that without error:
Neither using sp_dropmergefilter neither using replication properties window.
In both cases when I run stored procedure or press Mark for reinitialization in GUI I have following error:
Msg 512, Level 16, State 1, Procedure sp_dropmergefilter, Line 167
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Msg 3701, Level 11, State 5, Line 1
Cannot drop the procedure '[MSmerge_expand_29]', because it does not exist or you do not have permission.
The errors from GUI looks even uglier than from stored procedure.
I know the error is related to following peace of source code:
--drop expand proc and nullify the expand_proc column in sysmergepartitioninfo
select @procname = expand_proc
from dbo.sysmergepartitioninfo
where pubid=@pubid
and artid = ( select art.artid from dbo.sysmergearticles art, dbo.sysmergesubsetfilters filter
where art.name = filter.join_articlename and filter.pubid=@pubid and filter.artid=@artid)
However even if unhandled error is run it looks like sp is doing its job and that filter is removed and data is transferred properly. But in my opinion this bug should be fixed.