I've try to do the database restore in Microsoft SQL Server 2005 Express using sql command as below:
RESTORE DATABASE testJG
FROM DISK = 'c:\Program Files\Microsoft SQL Server\MSSQL.3\MSSQL\Backup\JGsql.bak'
GO
But I get this error message.
Msg 3102, Level 16, State 1, Line 1
RESTORE cannot process database 'testJG' because it is in use by this session. It is recommended that the master database be used when performing this operation.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Does this means that I need to restore the master database from systems database to the database testJG before I restore the backup database?
Give this a try....
With your query window active, make sure that the current database you have selected from the drop-down is the Master db and not the testJG database. That should free up your the active connection that SQL is complaining about.
You should then be able to execute your restore command.
Regards,
John
|||Or, to be more explicit, add the command
USE MASTER;
to the beginning of your session, before the restore command.
|||Owesome....it works...
thank you.....thank you!!! I love you guys....
that really solved my problem and I could successfully restore the database now....
No comments:
Post a Comment