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.
| Author |
Topic |
|
racinghart
Starting Member
49 Posts |
Posted - 2007-04-23 : 14:11:32
|
| ===================================System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)===================================any ideas?this is actually a restore from a BAK file saved from the live server. we copied the bak file over and placed it on the test server hard drive, now we are trying to restore this using SSMS |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-04-23 : 15:08:59
|
| Ensure there is no connection to target db, and you didn't run restore statement under it. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-04-24 : 04:17:06
|
| e.g.USE masterGOALTER DATABASE MyDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATEGORESTORE ...Kristen |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-24 : 12:43:19
|
| Stop the Reporting Services service as it will be hard to beat RS into the database after you kill the spids. RS quickly reconnects to the databases.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
racinghart
Starting Member
49 Posts |
Posted - 2007-04-24 : 15:53:04
|
| thank you Tara! It worked... i had to STOP the services for a minute... load the BAK and restart the Services. =) |
 |
|
|
|
|
|