Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 DB Restore -- DB in use error

Author  Topic 

dbaman
Starting Member

46 Posts

Posted - 2009-11-10 : 10:30:55
I have SQLServer 2005 Ent. Ed. I checked no other user is connected to the Target database now. When I am trying to do a restore from the earlier day's backup I am getting a message: DB in use everytime I try to make a DB resore from the database.bak file. Any idea?

I am trying to do Restore to a specific time using SQL Server Management Studio.

Thanks

R

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2009-11-10 : 15:15:20
Set the database offline to kill existing connections and prevent new connections before you start the restore
use master
alter database MyDB set offline with rollback immediate

restore database MyDB
... rest of restore command ...


CODO ERGO SUM
Go to Top of Page
   

- Advertisement -