user with dba permissions detach a database

  • What really happens when a DBA accidentally detaches a DB associated as the default DB to his account?

    It just had that happened here by one of our team members and I could easily attach the DB and he was back to it. But he could not even connect to SQL Server even though he had admin rights. Does the DB go into a single user mode? What is the best approach to avoid this in future?

    Thanks in advance.

  • I'd have them reconnect using sqlcmd and set their default database to something else to resolve the issue...

    sqlcmd -E -S MYSERVER -d master -q "alter login [domain\user] with default_database = something_else"

  • I had similar problems once.  What I is create a new Access data project, and reconnect to the server and then selecting a db.  If that fails you can always reconnect with ADO, then execute the sp that changes the default database for a user... not pretty but it works.

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

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