Results 1 to 6 of 6

Thread: database backup and recover

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    database backup and recover

    Hi all:
    In order to test database restore, I create a backup driver and puporse delete one table, then I try to restore my databse use backup, but the delete table donot show up.

    Thank you
    ________
    R51
    Last edited by sql; 03-06-2011 at 01:21 AM.

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    I believe you are using sql server.

    Did you do the following?

    use master
    go
    backup database yourdatabase to disk = 'd:\yourdatabase.bak' with init
    go
    use yourdatabase
    go
    drop table yourtable1
    go
    delete yourtable2
    go
    use master
    go
    restore database from disk = 'd:\youdatabase.bak' with replace
    go
    use yourdatabase
    go
    select * from yourtable1
    go
    select * from yourtable2

  3. #3
    Join Date
    Jul 2003
    Posts
    421

    database back and recover

    Hi:
    Thank you for the reply, I try by code and wizards, it did work, but after RESTORE DATABASE successfully, I can't saw the table that I delet in tables list when I went to my database and click the tables. may I know why??
    I figure up this by use the select suggest from your advice.
    by the way
    I use the code like
    backup database pubs
    to disk ='c:\pubsdump.dat'
    with description='Pubs test backup' ,
    init,
    stats=9
    it can create a backup driver.
    why you suggest master in here?
    ________
    Daihatsu Materia History
    Last edited by sql; 03-06-2011 at 01:21 AM.

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    you cannot restore a database when you are in that database. it is like cutting a branch (in a tree) by standing on that branch (at the far end).

  5. #5
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    May be it is not refreshed.

    Right click on the database and select Refresh.

  6. #6
    Join Date
    Jul 2003
    Posts
    421
    Hi all:
    thank you
    ________
    BUBBLER PIPE
    Last edited by sql; 03-06-2011 at 01:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •