--If you "Disable schema changes" in advance. The new column does not voluntarily join the big announcement. You should now use Sp_articlecolumn to join the column exec sp_changepublication @publication = n ' publication ', @property = N ' replicate_ddl ', @value = 0--"Remove and join the announcement without initializing all items, but the entry must be initialized"--Prohibit anonymous access to exec sp_changepublication ' publication ', ' Allow_anonymous ', false GO-- Do not immediately update exec sp_changepublication ' publication ', ' Immediate_sync ', false GO--Terminate single item replication (the table is advertised as normal, subscription should be disabled) Exec sp_ DropSubscription @publication = n ' publication ', @article = n ' article ', @subscriber = n ' subscriber ', @destination_db = N ' de stination_db ' go--Delete item from announcement (interface operation will be initialized again so project) Exec sp_droparticle @publication = n ' publication ', @article = n ' article ' go--join the project to the announcement (@schema_option personal requirements change) Exec sp_addarticle @publication = ' publication ', @article = N ' article ', @source_ Object = N ' article ', @source_owner = n ' dbo ', @schema_option = 0x0000000008037cdfgo--Joins an unpublished column (adds one more column to the published table, typically does not) Exec sp_ Articlecolumn @publication = ' publication ', @article = n ' article ', @column = n ' column ', @operation = n ' Add ' go--for row filtering (for filtering advertisement) Exec sp_articlefilter @publication = N ' publication ', @article = n ' article ', @filter_name = N ' fltr_article_1__1 ', @filter_clause = n ' id% 2 = 0 ' GO--row filter (for Filter advertisement) Exec sp_articleview @publication = n ' publication ', @article = n ' article ', @view_name = N ' sync_article_1__1 ', @filter _clause = N ' id% 2 = 0 ' GO-Refresh subscription to join project exec sp_refreshsubscriptions ' publication ' GO--start Snapshot Agent (Initialize new project) Exec Sp_startpublicat Ion_snapshot ' publication ' GO
Remove and join announcements in SQL Server replication without initializing all items