Avatar of CFS_developer
CFS_developer

asked on 

How to delete SQL server replication

On SQL Server 2008 R2, I am trying to setup transactional replication with test data and I'm getting an error:  
SQL Server could not create publication PubOne.
Database 'distribution' does not exist.  

This probably occurs because I previously tried to setup replication,
dropped my test databases, dropped distribution, and started over.

How do I fix this mess and truly start over?  


Here's what I tried to delete replication:

alter database ReplicationSource set offline
alter database ReplicationTarget set offline
alter database distribution      set offline
go

drop database ReplicationSource -- and remove disk files
drop database ReplicationTarget -- and remove disk files
drop database distribution      -- and remove disk files
go

exec sp_removeDbReplication 'ReplicationSource'
exec sp_removeDbReplication 'ReplicationTarget'
go

exec sp_dropdistributor   -- fails with    Could not drop the Distributor 'DAVIDZ-PC'. This Distributor has associated distribution databases.
go
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
CFS_developer
SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of Jason clark
Jason clark
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of CFS_developer
CFS_developer

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of CFS_developer
CFS_developer

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of CFS_developer
CFS_developer

ASKER

My input provided part of the solution
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo