wayne.fairless (12/23/2014)
We often run into this in our QA environments. The below script is a blunt hammer approach to remove replication, no matter how fubared your server is:USE <yourreplicateddb>
EXEC sp_removedbreplication '<yourreplicateddb>';
go
USE master
EXEC sp_dropdistpublisher @@servername, 1, 1;
EXEC sp_dropdistributiondb 'distribution';
EXEC sp_dropdistributor;
Note that the third parameter for sp_dropdistpubisher is an undocumented parm, but if you look at the code, it allows things to be forced.
Good Answer.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/