[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Delete SQL replikation

Posted on 2013-12-09
2
Medium Priority
?
594 Views
Last Modified: 2013-12-10
Hello

My server "SVR1" runs a SQL Server with a transactional publication. On the second server "SVR2" I had a subscription.
Now the SVR2 does not exist anymore and I want to delete the replication on SVR1. (in the SQL Management Studio, the subscription is still visible)

But if I want to delete the SVR2-subscription on the SVR1, I get the error message 20032 "Could not delete the subscription at Subscriber 'SVR2' in database 'ICSDB'."

It can not connect to the SVR2 anymore and this gives the problem of deleting this subscription.

I also tryed:
exec sp_dropsubscription @publication = N'ICSDB_Publication', @article = N'all', @subscriber = N'all', @destination_db = N'ICSDB'
GO
-> it gives me the same error message.

How can I dlete this subscription (and afterwards also the publication)

Thanks for your help

Eric

I'm using SQL Server 2008 R2 on Windows Server 2008R2
0
Comment
Question by:ICSAutomation
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
rk_india1 earned 800 total points
ID: 39706765
Right click on the publication, go to properties then to subscriptions. Click Delete. This is the EM way. For the QA way, generate the delete statement from EM.


For future use, I was having the same problems described above - but I also had database snapshots on the database that I was trying to remove replication from but that was not mentioned anywhere in the error messages.


reference Link:http://social.msdn.microsoft.com/Forums/sqlserver/en-US/b64bcde9-4769-45df-a8c7-19606c9c33ca/unable-to-drop-subscription?forum=sqlreplication


Once I removed my database snapshots, the following script cleans things up well:

Example came from here:  http://msdn.microsoft.com/en-us/library/ms188411.aspx
DECLARE @distributionDB AS sysname;
DECLARE @publisher AS sysname;
DECLARE @publicationDB as sysname;
SET @distributionDB = N'distribution';
SET @publisher = N'S-ESN-SQL1\SQL1';
SET @publicationDB = N'AdventureWorks2008R2';

-- Disable the publication database.
USE [AdventureWorks2008R2]
EXEC sp_removedbreplication @publicationDB;

-- Remove the registration of the local Publisher at the Distributor.
USE master
EXEC sp_dropdistpublisher @publisher;

-- Delete the distribution database.
EXEC sp_dropdistributiondb @distributionDB;

-- Remove the local server as a Distributor.
EXEC sp_dropdistributor;
GO
0
 

Author Closing Comment

by:ICSAutomation
ID: 39707992
Exactly what I needed!!
Thanks a lot.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question