Link to home
Start Free TrialLog in
Avatar of zimboman
zimbomanFlag for New Zealand

asked on

Cannot Delete Publication

I have lost access to the Distributor and Subscriber servers, and need to delete the publication.
I managed to delete the (pull) subscription database, locally only, so the subscription still shows as orphaned, on the publisher server.

I am trying to simply delete all replication related components.

I am trying to remove the publication, but I get an error that it cannot be removed due to a connected subscription.

I then try to remove the subscription, usign the script below - but I get a message that the subscription does not exist?

Can anyone help with why?

(Remove Subscription Command)

--Select your publication database

USE NeXus

GO

DECLARE @publication AS sysname;

DECLARE @subscriber AS sysname;

--enter your publication name

SET @publication = N'NxPub';

--enter subscriber name

SET @subscriber = N'NxSub';

USE [NeX]

EXEC sp_dropsubscription

@publication = @publication,

@article = N'all',

@subscriber = @subscriber

,@ignore_distributor=1;

GO
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

What the following command returns?
exec sp_helpreplicationdboption @dbname = N'NeXus', @reserved = 1

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You have to run sp_dropsubscription on Publisher and @subscriber parameter must be set to the subscriber server name and not the subscription name.
Avatar of zimboman

ASKER

Thanks - the dropsubscription command was what I was looking for.