Restore Database

  • Hello Every Body

    I'm using sql server 2008 R2 SP1.

    I have a backup file ,when i try to restore database from this backup file i see an error "Object cannot be cast from DBNull to other types. (mscorlib)"

    How can I solve this problem?

  • Is this what you see during restore operation or after restore?

    It doesn’t look SQL Server Error message.

  • Hi;

    Is this backup is OK?

    From which version of SQL it was taken and Are sure you are storing on SQL 2k8 r2 sp1? is any other Version's Instase on Box?

    Ali
    MCTS SQL Server2k8

  • what backup do you have is it from 2k8 R2 ??

    give the details to get help

  • Sounds like a client error, are you using the Restore Database Wizard? If you are using the GUI dont. Restore the database using TSQL, search 'RESTORE DATABASE' in BOL.

    Thanks

    Chris

    ------------------------
    I am the master of my fate:
    I am the captain of my soul.
    ------------------------
    Blog: http://sqlserver365.blogspot.co.uk/
    Twitter: @ckwmcgowan
    ------------------------
  • Did any of the tips help you?

  • Hello

    My Backup file is from sqlserver 2008 r2 sp1 and I try to restore it on another pc with sqlserver 2008 r2 sp1

    When I select backup file I see error :'Object cannot be cast from DBNull to other types. (mscorlib)"'

  • try restoring using a query

    restore database mydb from disk='<your path here>\<your backup file name>'

  • Did you already try restoring the database with a query?

  • Hi,

    I believe that your backup file is corrupted one. Please take back up again.

    Please use RESTORE VERIFYONLY option to make sure if the back up is not corrupted.

    You may refer this url : http://msdn.microsoft.com/en-us/library/ms188902.aspx

    Best Regards,

    Sudhir

  • CoolCodeShare (10/12/2011)


    Hi,

    I believe that your backup file is corrupted one. Please take back up again.

    Please use RESTORE VERIFYONLY option to make sure if the back up is not corrupted.

    You may refer this url : http://msdn.microsoft.com/en-us/library/ms188902.aspx

    Best Regards,

    Sudhir

    Actually that's only 99% sure. You need to restore the file to confirm it works (& ideally run checkdb as well).

  • Ninja is correct. The verifyonly will not necessarily prevent corruption. You need to do a restore, or mount the backup file using one of the tools, such as Red Gate's Virtual Restore (there are others) to ensure it's not corrupt.

    Also, you should be using WITH CHECKSUM on your backups as well.

  • Eskandari (10/12/2011)


    Hello

    My Backup file is from sqlserver 2008 r2 sp1 and I try to restore it on another pc with sqlserver 2008 r2 sp1

    When I select backup file I see error :'Object cannot be cast from DBNull to other types. (mscorlib)"'

    You can take backup again and use verify backup option (option is available in Backup screen -> Options -> Reliability -> Verify backup when finished) and try to restore it again.

    Thanks

  • i try to restore using this query :

    RESTORE DATABASE MyDatabase

    FROM DISK = N'C:\MyBackup.bak'

    WITH

    FILE = ?,

    NOUNLOAD,

    REPLACE,

    STATS = 10

    GO

    because there are many backups in 'C:\MyBackup.bak' file ,And I want to restore last file ,I don't Know What number to put in place of ?

  • Eskandari (10/15/2011)


    i try to restore using this query :

    RESTORE DATABASE MyDatabase

    FROM DISK = N'C:\MyBackup.bak'

    WITH

    FILE = ?,

    NOUNLOAD,

    REPLACE,

    STATS = 10

    GO

    because there are many backups in 'C:\MyBackup.bak' file ,And I want to restore last file ,I don't Know What number to put in place of ?

    Query MSDB..BACKUPSET table and search for MAX(POSITION) for your database backup.

    Position:

    Backup set position used in the restore operation to locate the appropriate backup set and files.

Viewing 15 posts - 1 through 15 (of 17 total)

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