Detached Default Database | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Detached Default Database

What is the best way to attach a detached default database after restarting the server? After detaching the default database in order to back up the mdf file, I restarted without reattaching it. Neither Enterprise Manager nor SQL Query were able to start up due to the inability to connect to the default database using windows authentication. Yours,
Deb Wolfe
Check out sp_attach_db in the Books Online. You can run this from Query Analyzer to attach your database. —————————–
Brad M. McGehee, MVP
Webmaster
SQL-Server-Performance.Com
what user are you connecting as ? Try connecting as sql login ‘sa’ if possible, or connect via a user whose default database is not the missing one. Then you can just reattach the db.

As suggested you could achieve the task, BTW what was the error from SQL error log after you restarted the services? _________
Satya SKJ

]]>