I am attempting to restore a database on a Windows SQL 2008 Server from a .bak file. The .bak file was created on another machine running Windows SQL 2005 Server. It was copied between the two machines using an external HDD.
The error message is "Object cannot be cast from DbNull to other types". It appears when I click the 'contents' button in the Specify Backup dialog box after pressing 'add' [media] to specify the name and location of the .bak file. The .bak was copied from
the external HDD onto an internal HDD (d:\backups\testme.bak)
I presume that the error message means that the contents of the file cannot be recognised. Does this mean that the .bak file is corrupt. What else might cause this problem?
I can restore the database from a .DMP (dump) file, but would prefer to use .BAK so in future I can just restore the changed records.
1. Log-in as the System Administrator (sa).
2. Select Databases and right click | Restore from Backup
3. Restore dialog set To = Image (name of new database) and From = Device, then click '...' button
4. Specify Backup dialog box - click 'Add'
5. Add Media dialog - Browse and select Image.bak (not in the default SQL directory for backups). Press OK to return to the Specify Backup dialog box.
6. Specify Backup dialog box - click 'Contents' button and get error message "Object cannot be cast from DbNull to other types"