问题
We have multiple subscriptions (merge pull) at our subscriber for only 1 "real" subscription. I think we actually broke it like this by adding and removing the subscription from the subscriber side, and then trying to replicate it... multiple times.
Now the problem is not that the replication does not work, I'm pretty confident that I the answer for that. The problem is that I can't drop/delete the broken subscriptions at the subscriber anymore. It just does not work.
When trying to run sp_dropmergepullsubscription
at the publisher, it tells me "No subscription is on this publication article".
When trying to run sp_dropsubscription
at the publisher, it tells me "This database is not enabled for subscription"
Yes I've checked that I was running all these scripts on the correct database and all that.
Has anybody had a problem like this before ? Do I need to re-do the publication and the subscription ?
Thanks guys and gals ! :)
回答1:
Try the following on the publisher:
EXEC sp_dropmergesubscription
@publication = '<publicationName>',
@subscriber = '<subscriberName>',
@subscriber_db = '<dbName>;
GO
delete sysmergesubscriptions where subscriber_server = '<subscriberName>'
use distribution
go
delete msmerge_Agents where subscriber_name = '<subscriberName>'
delete msmerge_subscriptions where subscriber = '<subscriberName>'
...then try setting the pull subscription back up
来源:https://stackoverflow.com/questions/7876913/sql-server-replication-removing-broken-subscriptions-at-the-publisher