SQL Server Delete distribution database II

Source: Internet
Author: User

I've summarized this once. SQL Server deletes the distribution database, which describes how to delete the distribution database. Today, we introduce a special case of deleting distribution,

Before that, I didn't know how the replication on this server had been tossed around, and there was no content related to publishing or subscriptions in the local publications and local subscriptions of the SSMs admin interface.

However, using the command exec Sp_helpdistpublisher will see the properties of the Publisher using the Distributor

The following SQL parameter @publisher corresponds to the value of the above name, where xxxx is used instead

 use master;
GO
exec ' xxxx '

We use the following SQL to find out that it has been published in the database (for the moment, a represents) a.

The following SQL is reported as an error, because there is a database-level trigger safety on this database, prohibit any DDL operation, after first disabling the trigger, the following SQL will be executed, the following part of the trigger will be cleaned up.

 use master;
Go
EXEC ' A '


Then follow the SQL Server delete distribution database inside the steps, according to gourd painting scoop, execute the following SQL, you can easily remove the distribution database.

 Use Artdb;
GO
exec ' xxx '
 use master;
GO
exec sp_dropdistributiondb @Database = N' distribution '
GO

SQL Server Delete distribution database II

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.