Unanswered: Royal f-up, dropped user default database
I am by no means a db administrator, so I apologize for my ignorance. However I do know that I screwed up and am unable to find the solution...
The small company I work for has a development SQL Server where we do testing and development for web based applications. While using SQL Server Enteprise Manager I accidentally dropped the user's default default database.
I have always been able to access the enteprise manager via windows authentication, but now I am unable to. Is there any way to set the default database back to 'master'? Currently I cannot connect with SQL Query Analyzer for the same reasons, and do not have any other access except via windows authentication. Is there any hope? Any help is much appreciated.
It looks like the default database was set to this very old database that had no tables, stored procedures, etc. So while doing clean up I dropped the database, unknowingly deleting the default database. Yeah, I get the moron award for the day.
You should be able to get this back with an administrator ID (either SA or local administrator logged in with widows authentication), but it will require a few cyclings of the service.
I believe (i.e. not tested) that if you restart the SQL instance with the -f flag (safe mode) you can log in with an admin ID, and run sp_defaultdb through query analyzer. Look up "Using Startup Options" in Books Online, and you should get an idea of what is involved. Good luck, and let us know how it comes out.
Thanks for the recommendation. Logging in as a network administrator I was able to access the database and change the other user's default database and set them back to master. I'll just chalk this up to learning a lesson the hard way.
Thanks to all those that helped. Perhaps my boss will send me to some classes now?