Search

Tuesday, April 3, 2012

How to restore single table from backup

You cannot restore the individual table(s) from a database backup! 

So, you had to follow the following steps to restore single table from Backup: 

1. Drop the corrupt table from your existing database. 
2. Restore your database from a backup under a different name (for example, test_db). 
3. Use DTS/Data Transformation Wizard to move/copy table from a newly restored test_db to your production database. 

This is the simplest way to implement what you require.  

3 comments:

  1. Thank you for sharing easy steps to restore corrupt SQL table. But these steps will work only for single table restoration or if we have updated backup copy. If you want to recover full database mdf or ndf files then you can try SQL Recovery Software. The software recovers full database as well as single objects of the database.

    ReplyDelete

  2. To export:

    bcp "[MyDatabase].dbo.Customer" out "Customer.bcp" -N -S ServerName -T -E -U"xxxxxx" -P"xxxxxxx"


    To import:

    bcp "[MyDatabase].dbo.Customer" in "Customer.bcp" -N -S ServerName -T -E -b 10000 -U"xxxxxx" -P"xxxxxxx"

    ReplyDelete
  3. thanks Arun for leaving this up, you can also take the help of this link to know different methods to restore a single table in SQL Server: http://sqltechtips.blogspot.com/2016/01/restore-deleted-table-data-in-sql.html

    ReplyDelete