SQL Server database restore error: specified cast is not valid. (SqlManagerUI)

前端 未结 4 793
情书的邮戳
情书的邮戳 2020-12-13 23:07

I am using SQL Server 2008 R2 Standard (version 10.50.1600.1) for my production website and SQL Server Express edition with Advanced Services (v10.50.1600.1) for my localho

4条回答
  •  攒了一身酷
    2020-12-13 23:39

    Finally got this error to go away on a restore. I moved to SQL2012 out of frustration, but I guess this would probably still work on 2008R2. I had to use the logical names:

    RESTORE FILELISTONLY
    FROM DISK = ‘location of your.bak file’
    

    And from there I ran a restore statement with MOVE using logical names.

    RESTORE DATABASE database1
    FROM DISK = '\\database path\database.bak'
    WITH
    MOVE 'File_Data' TO 'E:\location\database.mdf',
    MOVE 'File_DOCS' TO 'E:\location\database_1.ndf',
    MOVE 'file' TO 'E:\location\database_2.ndf',
    MOVE 'file' TO 'E:\location\database_3.ndf',
    MOVE 'file_Log' TO 'E:\location\database.ldf'
    

    When it was done restoring, I almost wept with joy.

    Good luck!

提交回复
热议问题