Restore

  • RESTORE DATABASE test

    --restore filelistonly

    FROM DISK = 'D:\BACKUP\test_db_200809150315.BAK'

    WITH NORECOVERY,

    with MOVE 'tws_dat' TO 'D:\Data\test.mdf',

    with MOVE 'tws_Log' TO 'D:\LOG\test_log.ldf'

    What is wrong with this above syntax, I am getting incorrect syntax near the keyword 'with'. Thank you.

  • You only need to specify "WITH" once...

    RESTORE DATABASE test

    --restore filelistonly

    FROM DISK = 'D:\BACKUP\test_db_200809150315.BAK'

    WITH NORECOVERY,

    MOVE 'tws_dat' TO 'D:\Data\test.mdf',

    MOVE 'tws_Log' TO 'D:\LOG\test_log.ldf'

  • Thank you. It works.

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

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