how to delete sql server Replication
Sticking with the theme of “following my nose“- I set about removing replication from my new ReplicationExample sqlLab.
While replication is still active, you can remove replication by right clicking Replication and selecting “Disable Publishing and Distribution“. This will remove the subscriptions, publications and also remove the distribution database. Couldn’t be easier.
Alternatively you can disable replication by running:
Run this code against the subscriber and publisher to disable replication.
Someone has restored a database from production into test. Unfortunately, this often creates orphaned replication artefacts that need to be cleaned up.
For this scenario, I have created a ExampleOrphanedReplication_sqlLab, as shown below. Notice the publication, ‘throwAwayPublication’, the existance of the distribution database, and no subscriptions.
If you now try to drop the publication, you get the following errors:
Alternatively, if you attempt to run the “Disable Publishing and Distribution
View original post 120 từ nữa