Backup and Restore Particular table from databse?

  • IS there anyway to backup particular table of database and later we can restore same same table on same server?

    Senario is: Developers going to update 2 tables of prod DB. They want me to backupp that two tables before they update and if something wrong happens they want me to restore that two tables back.

    so anyone have idea what to do in this case?

  • in that case, i usually just do a SELECT * INTO table_Bak

    FROM Table;

    with that it's very easy to update the original table from that side by side table in the database itself.

    i'd put together a full set of scripts to insert any rows that are missing, delete any new rows, and update existing,a ll based on that backup table.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (11/16/2011)


    in that case, i usually just do a SELECT * INTO table_Bak

    FROM Table;

    with that it's very easy to update the original table from that side by side table in the database itself.

    i'd put together a full set of scripts to insert any rows that are missing, delete any new rows, and update existing,a ll based on that backup table.

    In addition to what Lowell said

    •I would also preserve DDLs for table (Indexes, Keys as well), in case you required to delete those tables (absolutely worst scenario).

    •If these tables are HUGE insert scripts is not a good idea.

    •I would create one extra copy in another DB (SQL/Access) with Export Import Wizard, just to make sure I will have more option to recover from.

    Caution: It’s a very bad practice to perform such operations on PROD. Try the steps in DEV / DEMO environment first.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply