--If you "Prohibit schema changes" in advance, the new columns will not automatically add a large release, you should use Sp_articlecolumn to add the column exec sp_changepublication @publication = N ' publication ', @ property = N ' Replicate_ddl ', @value = 0--"Remove and add the publication without initializing all items, but the added item must be initialized"--Disallow anonymous access to exec sp_changepublication ' Publication ', ' allow_anonymous ', false go--Disable immediate update of EXEC sp_changepublication ' publication ', ' Immediate_sync ', false go-- Terminates a single item copy (the table is in the normal operation of the publication, the subscription should prohibit the operation) Exec sp_dropsubscription @publication = n ' publication ', @article = n ' article ', @subscriber = N ' Subscriber ', @destination_db = N ' destination_db ' go--delete the item from the publication (the interface operation will reinitialize so the project) Exec sp_droparticle @publication = n ' publication ', @article = n ' article ' go--add items to the release (@schema_option reference personal requirements change) Exec sp_addarticle @publication = ' Publication ', @article = n ' article ', @source_object = n ' article ', @source_owner = n ' dbo ', @schema_option = 0x0000000008037 Cdfgo--Add unpublished column exec sp_articlecolumn @publication = ' publication ', @article = n ' article ', @column = n ' column ', @operation = N ' Add ' go--for row filtering (for filtering publications) 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 filtering publications) Exec Sp_articlevi ew @publication = n ' publication ', @article = n ' article ', @view_name = N ' sync_article_1__1 ', @filter_clause = n ' id% 2 = 0 ' Go-Refresh subscription to add Project exec sp_refreshsubscriptions ' publication ' GO--start Snapshot Agent (initialize new project) EXEC Sp_startpublication_snapshot ' Publication ' GO
SQL Server removes and adds publications without initializing all projects