When removing replication from a server using the wizard you might get the below error message if you choose to drop the distribution database.
The reason for the above message is because the agents are still running on the server. Disable the agents and then run the Disable publisher and distribution wizard to get rid of the distribution database.
You can also run sp_who2 to verify which process is using the distribution database and then kill it and run the wizard but I wouldn’t advice it.
This post was written by Jayanth Kurup. A Microsoft SQL Server Consultant and Trainer based out of Bangalore, India. Jayanth has been working on MS SQL Server for over 15 years. He is a performance tuning and Business Intelligence expert. Having worked with companies like Microsoft, DELL, Wells Fargo, Thomson Reuters and many other fortune 100 companies. Some other technologies Jayanth works on include Microsoft Azure, PowerBI, Python and AWS. When he isn’t consulting or training, Jayanth like to travel, paint and read. He is also very active in social causes and the founder of Enabled Business Solutions. Visit his company by clicking the link in the menu or email him directly.