Remove and join announcements in SQL Server replication without initializing all items

Source: Internet
Author: User

--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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.