Restore problem

  • hello..

    In Management Studio I used common database server .when I restore back up file 'School.bak'..This bak file the error message is displyed like this.This database already existed and I changed name and restorded it .Then I face bellore erro

    Error:

    Restore failed for server 'DEVSERVER01'(Microsoft.SqlServer.Smo)

    Additional information :

    System.Data.SqlClient.SqlError:The file'C:\Program Files\Microsoft Sql

    server\Mssql.1\MSSQL\DATA\School.mdf' cannot be overwritten.It is

    being used by database 'school'.(Microsoft.SqlServer.Smo)

    Thanks
    Dastagiri.D

  • Your are getting the error because you have a database with a different name then the database that you are restoring that has the same files' name and path as the database that you are restoring. If the server will let you continue the restore operation, you'll might destroy a working database by mistake. In cased like this, you have to let the server know that this is not a mistake. I recommend that you'll read in books on line about restore database and take a look at the replace and move options. Since I don't do backup and restores with the GUI, I don't know how to do it using the GUI.

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • So, when you changed the DB name from "school" to "School_Restored" you also must change the MDF and LDF to "School_Restored.mdf" and "School_Restored.ldf". Usually SQL does that for you when using the GUI to restore to a new name.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply