MS SQL server 7.0 restore/create

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MikeB
    New Member
    • Mar 2006
    • 1

    MS SQL server 7.0 restore/create

    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:\worksp ace\T1772\Q1772 NMT\SourceCode\ Co
    mmon\TNMT_Relea se\UNICODE_Debu g\Data\Master.d at'
    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\T 1772\Q1772NMT\S ourceCode\Commo n\TNMT_Release\ UNICODE_Debug\D ata\
    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 ?
    Last edited by MikeB; Mar 20 '06, 11:29 PM.
Working...