System.Data.SqlClient.SqlError: Could not perform delete on procedure ' XXX ' because it is being used for replication. Msg 3724, Level 16

Source: Internet
Author: User

Encounter such a mistake, want to set up a copy of [NorthwindCS] This database, from B server to publish a subscription to C server, with a backup restore to initialize, but in the database restore, the report cannot delete the process ' XXX ' because it is being used for replication. It feels a little strange on the surface, why I will report this error when I restore the database, what is the mechanism of restoring the database, how to delete a stored procedure or view and so on. But the back "it's being used for replication" gave me the idea of solving the problem.

By understanding the architecture, the NorthwindCS database on the B server is also a subscription from a server, and now because a server is a very important trading system, do not want C server directly from a server subscription, but subscribe to the database on the B server. This re-configured the distribution on the B server and created the publication. However, the following error is reported when restoring on a C server after backup:

  

The suspicion is that the publication of the library created on the B server causes a problem with the backup set and an error when restoring on the C server. The publication created on the b server is then deleted, re-backed, restored, and no exception has occurred.

There is a question here, is not all configured to publish the database, his backup will be problematic, restore will be a problem? In order to eliminate this doubt, a server on the same library to be backed up on the C server to restore, incredibly no error! Then the question came, why the backup of B-server is problematic, although the NorthwindCS library on the B server is subscribed from a server, and the publication is created again. (This problem has not been resolved, ask the big God to the younger brother science)

Here is a point where database replication, not library-level, object-level, publish all objects are not all published in the past, view and stored procedures can be published. But each table, in addition to the statistics that are associated with the clustered index, including the primary key and the primary key, will not pass, and other indexes, foreign keys, database users, constraints, triggers, and statistics will not be published.

When the Publisher publishes views and indexes, the objects are marked as copied, so they cannot be deleted, they must be canceled before they can be deleted, or title errors are reported.

System.Data.SqlClient.SqlError: Could not perform delete on procedure ' XXX ' because it is being used for replication. Msg 3724, Level 16

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.