Use TSQL to delete one or more tables from the sqlserve publishing and subscription chain

Source: Internet
Author: User
A simple stored procedure is used to delete one or more tables from a SQLSERVE publish/subscribe chain. * 1.stop daily Reader Agent 2.exe cusp _ Delete the table dbtestPub and test13. open the Log Reader Agent author: 51 akdate: 20130509 run the * createprocusp _ command to delete the table from the replication subscription

A simple stored procedure is used to delete one or more tables from a SQLSERVE publish/subscribe chain. /* 1.stop the Log Reader Agent 2.exe c usp _ Delete the table 'dbtestpub', 'test1' 3 from the copy and subscription. run the log reading agent author: 51ak date: 20130509 on the server where the logstore is located. Execute */create proc usp _ to delete the table from the copy subscription.

A simple stored procedure, Hong Kong Space and Hong Kong server, is used to delete one or more tables from a SQLSERVE publish/subscribe chain.

/* 1.stop the Log Reader Agent 2.exe c usp _ Delete the table 'dbtestpub', 'test1' 3 from the copy and subscription. run the log reading agent author: 51ak date: 20130509 on the server where the logstore is located. Execute */create proc usp _ to delete the table from the copy subscription (@ release name varchar (255 ), @ table name varchar (255) asdeclare @ SQL varchar (8000) set @ SQL = 'exec sp_dropsubication @ publication = n''' + @ release name + ''', @ article = n''' + @ table name + ''', @ subscriber = n''all ''; EXEC sp_droparticle @ publication = n''' + @ release name + ''', @ article = n''' + @ table name + ''', @ force_invalidate_snapshot = 1 'print @ sqlexec (@ SQL) go, Vm

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.