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?


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

| 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 '14 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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