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
 General SQL Server Forums
 New to SQL Server Programming
 error while restoring the ReportServer db in SSMS

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.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-04-24 : 04:17:06
e.g.

USE master
GO
ALTER DATABASE MyDatabaseName SET SINGLE_USER WITH ROLLBACK IMMEDIATE
GO
RESTORE ...

Kristen
Go to Top of Page

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 Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

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. =)
Go to Top of Page
   

- Advertisement -