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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server DB Restore to Different DB Name 1

Status
Not open for further replies.

whloo

Programmer
Apr 14, 2003
168
SG
Hi,

I always do a full backup of my database named "LMS".
Lets say now i want to have another database (new DB name is LMS1) that have exactly the same content as LMS.
I tried to use "Restore database" option but it seems to give me this error:
"You are attempting to overwrite an existing database. Check the force restore over existing database option to overwrite the existing database."

Then i go to check the force restore option but it give me another error:
"The file 'c:\program files\microsoft sql server\mssql\data\LMS_Data.MDF' cannot be overwritten. It is being used by database ''LMS.
File 'LMS_Data' cannot be restored to 'c:\program files\microsoft sql server\mssql\data\LMS_Data.MDF'. Use WITH MOVE to identity a valid location for the file.
..........
......
RESTORE DATABASE is terminating abnormally.
"

Please help.
Thanks!

Regards,
weihann.
 
You should be able to perform the following to restore your existing database LMS as a new database LMS1:
[ol][li]From Enterprise Manager right click on Databases[/li][li]All Tasks --> Restore Database...[/li][li]General tab --> Restore as database[/li][li]Enter the new database name here (LMS1)[/li][li]Choose the restore method[/li][ol][li]If FROM DEVICE and you are restoring from or to a different location, once you reach the Restore Database window with the General & Option tabs:[/li][li]Click on Options tab[/li][li]Change the path for each item listed in the Logical file name grid[/li][/ol][li]Follow through the OK buttons until the process begins[/li][/ol]

That should work. Good luck.


Krickles | 1.6180

 
Thanks Krickles for your help!!!
It works now :)
really appreciate it :)
Thanks again.
 
Krickles,


Do you know the code to set the method you recommended up as a JOB ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top