Problem :
I am maintaining a legacy application which is distributed with
a default database, loaded from a file called Master.dat.
I wish to update the values of 10 fields in 1 table.
I can restore a database from Master.dat within the (C++ and SQLDMO) app.
If I try to restore from command line osql, the restore fails :
C:\>osql -E -S xxxx
1> restore database tnmt002 from disk='C:\workspace\T1772\Q1772NMT\SourceCode\Co
mmon\TNMT_Release\UNICODE_Debug\Data\Master.dat'
2> go
Msg 3242, Level 16, State 1, Server xxxx, Procedure , Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]The file on device
'C:\workspace\T1772\Q1772NMT\SourceCode\Common\TNM T_Release\UNICODE_Debug\Data\
Master.dat' is not a valid Microsoft Tape Format backup set.
Msg 3013, Level 16, State 1, Server xxxx, Procedure , Line 1
[Microsoft][ODBC SQL Server Driver][SQL Server]Backup or restore operation
terminating abnormally.
If I save the database from within the application (to Master2.dat, say) , and then do a restore in osql, that works OK.
However, the original Master.dat, and the new Master2.dat show
considerable binary differences.
In particular, the first four bytes of the new file contain the ASCII characters 'TAPE'.
[Presumably the header for a valid Microsoft Tape Format backup set]
The databases appear to verify against each other when doing SQL object comparisons.
All I want to do is change the values of 10 entries in 1 table, and reissue
the software.
In my simplistic view of the universe, this would mean 10 bytes difference
between the original Master.dat, and the new Master.dat.
I am suspicious that if I distribute the new version of the file, I
will lose/break some existing behaviour due to either
a) Having run the database through a running application or
b) Made magical changes due to the new format of the backup file.
Does anyone have an explanation for the format difference, or
maybe a way of saving the modified database in the original Master.dat format ?
Or, a way of restoring from the "old" format - whatever that is ?