Deleted default database, login failed

  • On my test server, to make sure I removed all trace of a failed ERP upgrade, I removed the ERP database, which was set as default. This is SQL 2000, ver 8.00.194.

    I can not log in or connect in Enterprise Manager or Query Analyzer to change or add a database. Is there some way around this?

    I tried to access through command line: osql -Q"sp_defaultdb...", but I'm not having much luck. Can anyone point me in the right direction?

    Bill B

  • Go to the server's machine. Add yourself to the local admins. Login with windows authentication and then change the default db to the other logins. I've read that master is a good choice, not sure if it's still the recommendation, but it would avoid that little issue you're having!

  • I already was a local admin, but that thought got me to trying an osql command using the windows login.

    OSQL -E -S "Servername" -d master -Q "EXEC sp_defaultdb 'Login', 'New default db'"

    I got this from a post on another forum. Since the test installation has only one server, and -S will default to that, i was able to omit that. Otherwise, this finally worked. I can log in to the Master database, at last. Now I just need to restore my db from the latest backup from the live system.

    Bill

  • Bill Beadenkopf (7/27/2011)


    I already was a local admin, but that thought got me to trying an osql command using the windows login.

    OSQL -E -S "Servername" -d master -Q "EXEC sp_defaultdb 'Login', 'New default db'"

    I got this from a post on another forum. Since the test installation has only one server, and -S will default to that, i was able to omit that. Otherwise, this finally worked. I can log in to the Master database, at last. Now I just need to restore my db from the latest backup from the live system.

    Bill

    That sounds like what saved my butt 8 years ago :hehe:. That or from another working connection in access (with dbo permissions).

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply