I have a backup of a database called PandL. I have another database called zTest. I wish to restore the PandL backup over zTest. The goal here is to have zTest as an exact copy of PandL for testing purposes. I'm trying to do this through Enterprise manager.
From the right click menu, I select restore database, I select zTest and then choose my most recent backup from PandL. I check the option to 'Force restore over existing database'. When I click OK, I get an error "Exclusive access could not be obtained because the database is in use". There is no one else connected to the zTest database although it is possible an application has an open connection. So I need to know how to sever all connections.
I attempted detaching the database. I got a message saying there were active connections and would I want to clear them. I said Yes, but then when i went to restore the database I got the same error.
I also tried to just delete the database, but again I get the error that there is an open connection and the database cannot be deleted.
As you can tell I'm not that advanced with SQL server. I'm willing to do this through a query in query analyzer if I need to, but I need to know the exact statement since I am not familiar with the language.