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
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.