5

I've done a copy of my database, using SQL Server 2008 R2 (DB -> Tasks -> Back Up).
Now I'm trying to restore it (DB -> Tasks -> Restore DataBase).

But SQL Studio give me an error and say, that I need to delete old DB to do it. How to restore it without deleting?

1
  • 1
    Please tick mark on option - Overwrite the existing database (With Replace) in "Restore option" while you restore your database. Commented Jan 24, 2014 at 8:55

3 Answers 3

4

I'm assuming you want a second copy of your DB, but with another name... since you want to "restore it without deleting"? You can definitely do this.

  1. Instead of selecting your current DB, right click on the "Database" item in the object explorer window
  2. In the context popup window select "Restore Database...".
  3. In the window that pops up, enter in a 'To Database' name for your copied DB, i.e. the new name for the DB copy. So if your original was TradeWind, call this one TradeWindCopy for example.
  4. Make sure the 'From database' radio button is selected, and in the dropdown select the backup you just made (tick the required check box). You could also restore 'from device' if you wanted - in that case you need to select a ".bak" file to restore from.
  5. Click the OK button and your DB backup is now restored as the new DB with the name you set in step 3.

Good luck.

2
  1. there's an option called "Overwrite the existing database" click on it and it will work.
  2. By renaming the old / new database you can achieve that. ( probably not want u want )

Similar question

Similar question 2

Here's an explanation from MSDN

Small tutorial

http://www.mssqltips.com/sqlservertutorial/121/restore-sql-server-database-and-overwrite-existing-database

1
  • 1
    But I don't need to overwrite. I just want to do smth. with copy of db, but the original db I don't want to touch Commented Jan 24, 2014 at 9:02
0

You can Simply use a script to achieve that,

    RESTORE DATABASE newdbname FROM disk='database location on drive'

This will restore you database with a new name without tampering with your current databases on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.