zimboman
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to run sp_dropsubscription on Publisher and @subscriber parameter must be set to the subscriber server name and not the subscription name.
ASKER
Thanks - the dropsubscription command was what I was looking for.
Open in new window