[问题]
带过滤的复制项UI操作导致订阅全部初始化,但是想不全部初始化,只初始化对应的复制项
[解决]
1.如果修改过滤项,可以直接执行,然后生成快照:
exec sp_articlefilter @publication = N'testdb', @article = N'tablea' , @filter_name = N'FLTR_tablea_1__97', @filter_clause = N'[Loc] =''WD2'' or [Loc] =''TDC''', @force_invalidate_snapshot = 1
, @force_reinit_subscription = 1
-- Adding the article synchronization object
exec sp_articleview @publication = N'testdb', @article = N'tablea' , @view_name = N'SYNC_tablea_1__97', @filter_clause = N'[Loc] =''WD2'' or [Loc] =''TDC''', @force_invalidate_snapshot = 1
, @force_reinit_subscription = 1
2.删除过滤项
exec sp_articlefilter @publication = N'testdb', @article = N'tablea' ,
, @force_reinit_subscription = 1
-- Adding the article synchronization object
exec sp_articleview @publication = N'testdb', @article = N'tablea' ,
, @force_reinit_subscription = 1
3.直接删除复制项
exec sp_dropsubscription @publication=N'testdb', @article=N'tablea', @subscriber=N'all'
EXEC sp_droparticle @publication = N'testdb', @article = N'tablea',@force_invalidate_snapshot=1