SQLServer remove and add releases without initializing all projects.
-- If you disable schema change in advance, the newly added columns will not automatically add a large distribution. In this case, use sp_articlecolumn to add the column EXEC sp_changepublication @ publication = N 'publication ', @ property = n' replicate _ ddl ', @ value = 0 -- [remove and add a release without initializing all projects, however, the added project must be initialized. -- disable anonymous access to Exec sp_changepublication 'publication ', 'Allow _ anonus us', and false GO -- disable immediate update of Exec sp_changepublication 'publication ', 'Immediate _ sync', false GO -- terminate the replication of a single project (the table can be normally operated upon publishing, and the subscription should be prohibited) Exec sp_dropsubication @ publication = n' publication ', @ article = N 'Article', @ subscriber = n' subscriber ', @ destination_db = n'destination _ db' GO -- delete a project from the release (the project will be reinitialized by the interface operation) Exec sp_droparticle @ publication = n'publication ', @ article = N 'Article' GO -- add a project to the release (@ schema_option can be changed according to personal requirements) Exec sp_addarticle @ publication = 'publication ', @ article = N 'Article ', @ source_object = N 'Article', @ source_owner = N 'dbo', @ schema_option = 0x0000000008037CDFGO -- add unpublished column Exec sp_articlecolumn @ publication = 'publication ', @ article = n'article', @ column = n'column', @ operation = n'add' GO -- filters rows (used to filter publishing) exec sp_articlefilter @ publication = N 'publication', @ article = N 'Article', @ filter_name = N 'fltr _ article_1 _ 1 ', @ filter_clause = n'id % 2 = 0' GO -- performs row filtering (used for filtering and publishing) Exec sp_articleview @ publication = N 'publication ', @ article = N 'Article ', @ view_name = n' SYNC _ article_1 _ 1 ', @ filter_clause = n'id % 2 = 0' GO -- refresh the subscription to add the project Exec sp_refreshsubscriptions 'publication' GO -- start the snapshot proxy (initialize the new project) Exec sp_startpublication_snapshot 'publication' GO