Home Forums SQL Server 2012 SQL Server 2012 - T-SQL MSG 3154 The backup set holds a backup of a database other than the existing database. RE: MSG 3154 The backup set holds a backup of a database other than the existing database.

  • sirvikasrana (7/14/2014)


    Here is my Code:

    RESTORE DATABASE SomeDBTest FROM DISK = 'E:\MSSQLBackup\SomeDB.bak'

    WITH RECOVERY, REPLACE,

    MOVE 'SomeDBTest' TO 'E:\MSSQLBackup\SomeDBTest.mdf',

    MOVE 'SomeDBTest_Log' TO 'E:\MSSQLBackup\SomeDBTest_log.ldf'

    ------------------------------

    Msg 3234, Level 16, State 2, Line 2

    Logical file 'SomeDBTest' is not part of database 'SomeDBTest'. Use RESTORE FILELISTONLY to list the logical file names.

    Msg 3013, Level 16, State 1, Line 2

    RESTORE DATABASE is terminating abnormally.

    That failed because the logical file names were wrong. The logical file names come from the backup (from the DB which was the source of the backup), they're not defined by what you're restoring to.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass