[?]Restore and Backup problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spieg

    [?]Restore and Backup problem

    I've a program with VB6 working with SQLServer 2000.
    I have a Central Station with the program runnin with full prvileges and
    that can perform all the actions on the DB.
    There are also some clients that cannot be connected via LAN or internet
    that need to use the same DB.
    The way I solved this with Aces was to copy the Access file from the Central
    Station ot the disconnected clients.
    Then to update the central Staton I used to save the recordset of new data
    entered from there onto files and then copy them into the Central Station.
    Now I'm upgrading the program to run with SQLServer.
    I can do everything but the Backup and restore of the DB.
    Actually I perform the DB Backup to file with the command line

    BACKUP DATABASE myDB TO DISK = 'TempFileName.b ak'

    This way I can save the file on a USB key or send it via email

    Then I restore it on the disconnected clients using the command line

    RESTORE DATABASE myDB FROM DISK ='TempFileName. bak' WITH REPLACE

    Everything looks fine and seems to work, but on my testing machine I'm
    having this strange behavior:

    I create new datas into the DataBase, then I execute the backup and quit the
    application.
    I open EM and delete the just entered datas
    I open the application simulating the disconnected clinet (just a string
    option, the program is the same)
    I execute the RESTORE
    I expect hte cancelled datas to be back online, but....... the cancelled
    datas is not restored.
    I then open EM and execute a backup from the file I created with Backup and
    ...... the data goes in.
    Why?
    Is the problem raised only becouse the SQLServer is the same in both cases?

    What I need is just to copy one DB and inserting it into a different Server.
    Any idea why this is appening?
    Any idea on how to do this operation?

    I tryed already the RECOVERY, NORECOVERY and quite everything, but .......

    Thanks in advance for your help


  • Dan Guzman

    #2
    Re: [?]Restore and Backup problem

    Perhaps you are inadvertently appending to the backup file instead of
    overwriting. Try

    BACKUP DATABASE myDB TO DISK = 'TempFileName.b ak' WITH INIT

    --
    Hope this helps.

    Dan Guzman
    SQL Server MVP

    "Spieg" <spiegator@tisc ali.it> wrote in message
    news:WgQUc.1201 73$OR2.6141961@ news3.tin.it...[color=blue]
    > I've a program with VB6 working with SQLServer 2000.
    > I have a Central Station with the program runnin with full prvileges and
    > that can perform all the actions on the DB.
    > There are also some clients that cannot be connected via LAN or internet
    > that need to use the same DB.
    > The way I solved this with Aces was to copy the Access file from the[/color]
    Central[color=blue]
    > Station ot the disconnected clients.
    > Then to update the central Staton I used to save the recordset of new data
    > entered from there onto files and then copy them into the Central Station.
    > Now I'm upgrading the program to run with SQLServer.
    > I can do everything but the Backup and restore of the DB.
    > Actually I perform the DB Backup to file with the command line
    >
    > BACKUP DATABASE myDB TO DISK = 'TempFileName.b ak'
    >
    > This way I can save the file on a USB key or send it via email
    >
    > Then I restore it on the disconnected clients using the command line
    >
    > RESTORE DATABASE myDB FROM DISK ='TempFileName. bak' WITH REPLACE
    >
    > Everything looks fine and seems to work, but on my testing machine I'm
    > having this strange behavior:
    >
    > I create new datas into the DataBase, then I execute the backup and quit[/color]
    the[color=blue]
    > application.
    > I open EM and delete the just entered datas
    > I open the application simulating the disconnected clinet (just a string
    > option, the program is the same)
    > I execute the RESTORE
    > I expect hte cancelled datas to be back online, but....... the cancelled
    > datas is not restored.
    > I then open EM and execute a backup from the file I created with Backup[/color]
    and[color=blue]
    > ..... the data goes in.
    > Why?
    > Is the problem raised only becouse the SQLServer is the same in both[/color]
    cases?[color=blue]
    >
    > What I need is just to copy one DB and inserting it into a different[/color]
    Server.[color=blue]
    > Any idea why this is appening?
    > Any idea on how to do this operation?
    >
    > I tryed already the RECOVERY, NORECOVERY and quite everything, but .......
    >
    > Thanks in advance for your help
    >
    >[/color]


    Comment

    • Spieg

      #3
      Re: [?]Restore and Backup problem

      Right, the WITH INIT Worked, damn I read it, but ....
      Thanks

      "Dan Guzman" <danguzman@nosp am-earthlink.net> ha scritto nel messaggio
      news:c3UUc.6485 $3O3.6087@newsr ead2.news.pas.e arthlink.net...[color=blue]
      > Perhaps you are inadvertently appending to the backup file instead of
      > overwriting. Try
      >
      > BACKUP DATABASE myDB TO DISK = 'TempFileName.b ak' WITH INIT
      >
      > --
      > Hope this helps.
      >
      > Dan Guzman
      > SQL Server MVP
      >[/color]


      Comment

      Working...