Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Point in time Recovery

Status
Not open for further replies.

19771947

Technical User
May 11, 2006
6
US
I have a SQLServer 2005 database. I want to restore from the backup to 2 days back point in time. I am using the Microsoft SQLServer Managment Studio. After I pick the file and specify the time I keep getting the error:


System.Data.SqlClient.SqlError: RESTORE cannot process database 'DBNAME' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo

I did a server reboot to clear off any hanging session.Stil I am getting the message. Please suggest.

Thanks
 
Force the server to point to a different database. Open up a new query, and type:

Code:
USE master 
RESTORE DATABASE DBName FROM DISK = 'c:\MyDBBackup.bak'

Where DBName is your database and C:\MyDBBackup.bak is the file you're restoring.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top