how to restore .ndf file in database SQL 2005

  • let us say my database in source server is cake_test and the database in the target server is also named as cake_test.

    Now the backup of the database from the source server has the following files:

    OriginalFile Name &nbsp Restore As

    cake_test &nbsp &nbsp cake_test.mdf

    cream_data &nbsp &nbsp cake_test.ndf

    creamlayer_data &nbsp &nbsp cake_test.ndf

    cream_dat &nbsp&nbsp cake_test.ndf

    cake_test_log &nbsp&nbsp cake_test.ldf

    cream_log &nbsp &nbsp cake_test.ldf

    As instructed by you I have done the following:

    RESTORE DATABASE cake_test

    FROM DISK='D:\cake_test.bak'


    MOVE 'cake_test' TO 'D:\MSSQL\DATA\cake_test.mdf'

    ,MOVE 'cream_data' TO 'D:\MSSQL\DATA\cake_test.ndf'

    ,MOVE 'creamlayer_data' TO 'D:\MSSQL\DATA\cake_test.ndf'

    ,MOVE 'cream_dat' TO 'D:\MSSQL\DATA\cake_test.ndf'

    ,MOVE 'cake_test_log' TO 'D:\MSSQL\DATA\cake_test.ldf'

    ,MOVE 'cream_log' TO 'D:\MSSQL\DATA\cake_test.ldf'


    but no luck. I got the following error " RESTORE cannot process database 'cake_test' because it is in use by this session. It is recommended that the master database be used when performing this operation. "

    Am i doing anything wrong here??

    Please suggest.

  • If built-in DBCC CHECKDB/repair tools fail to repair and restore the corrupt or damaged SQL server databases, it is good to opt for a third party application like this:

    This third party tool has been developed with strong scanning technology to analyze the database deeply and repair the corrupted items.

  • Try putting

    USE Master


    before your "restore database" statement - you've probably got management studio pointing at the database you're trying to restore - it's a common slip up.

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

Viewing 6 posts - 16 through 20 (of 20 total)

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