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
 Restore Command

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2011-06-28 : 09:54:47

Hi,

I am trying to restore a SQL database and use the following synatx -

Right click the database - Tasks - Restore - Database

Select the database backup location (checked Restore button)

and in Options (checked) : overwrite the existing database..

I receive the error;

Restore failed for server

Additional Information:

Restore cannot process database 'GPRDTech' because it is in use by this session. It is recommended that the master database be used when performing this operation (Microsoft.SqlServer.Smo)

Any help please!

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-28 : 10:12:24
It's because your current session is connected to that database.
Click on another database and display it's properties.
Then right click on databases to do the restore

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2011-06-28 : 10:56:17
Tried that still doesnt work!
Go to Top of Page

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-06-28 : 11:22:09
Then have a look to see what's connected to the database and kill it.


==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -