Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm setting up my first Distributor database on SQL Server 2012. I successfully created one and then wanted to blow it away and perform the task again just for practice.

This was a brand new Distributor and nothing had been done with it yet.

In my naivete I ran the the following commands before disabling the publishing and distribution:

alter database distribution set offline;
drop database distribution;

Now when I try to disable it, I get the following error:

SQL Server could not disable publishing and distribution on '<server>'.
------------------------------
Database 'distribution' does not exist. Make sure that the name is entered correctly.
Changed database context to 'master'. (Microsoft SQL Server, Error: 911)

Is there a way I can fix this?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

I Googled it -- http://www.sqlrepl.com/sql-server/accidentally-dropped-distribution-database/ -- try to follow his advice!

share|improve this answer
3  
Thanks, I had looked at this earlier and didn't think it would work because I had not done anything with the database yet. Found the MDF and LDF files and worked like a charm. –  ProfessionalAmateur Feb 10 at 22:13

The good thing is that you offline the database and then dropped it. So the files will be around. Just attach them and you will be good to go.

Always backup your database before doing anything like modifying, dropping, etc.

Also, How to Rebuild the Distribution Database KB describes the steps if you dont have the files as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.