Back up into new database

  • Hi,

    Im currently using SQL server 2000 and 2005. I had copied the pubs database into sql 2005 and i have a pub backup file. Now my question is, I had created a new database first called "Mydb" and I want the pubs.bak file to be copied into the new database called mydb can it be possible?

    Thanks,

    Ravi Shankar.

  • You can restore the backup of pub DB with another name (can be myDB)

    but if you have a DB already created, it is not at all possible to restore backup of 1DB into another.

    SQL Server Overwrites the Database if the DB already exists with the same name.

    Regards,
    Sarabpreet Singh 😎
    Sarabpreet.com
    SQLChamp.com
    Twitter: @Sarab_SQLGeek

  • I agree, take the current backup and rather restore it as the new name.

    This will keep structure etc i place.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • Sarab. (2/26/2010)


    You can restore the backup of pub DB with another name (can be myDB)

    but if you have a DB already created, it is not at all possible to restore backup of 1DB into another.

    SQL Server Overwrites the Database if the DB already exists with the same name.

    If the database exists, you can restore a different database over the top of it. The two will not merge, an overwrite will occur. When doing this, you must ensure that filenames are renamed and the overwrite option is selected. When doing the restore, the existing database name will remain and the schema from the backup will be applied.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Appreciate you all for your response ..

    but can any one tell me how to overwrite a already created database with a backup file.

    Thanks & Regards,

    Ravi Shankar

  • RaviShankar1234 (2/26/2010)


    Appreciate you all for your response ..

    but can any one tell me how to overwrite a already created database with a backup file.

    Thanks & Regards,

    Ravi Shankar

    Here's an article with the steps.

    http://msdn.microsoft.com/en-us/library/ms177429.aspx

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Cool Got it!!!!!!

Viewing 7 posts - 1 through 6 (of 6 total)

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