Advertisement
Advertisement


How do I restore a single table from a SQL Server 2005 backup?


Question

I've got a backup made using the regular SQL Server 2005 backup command. Is there a way to restore just a single table, not the whole DB?

2008/11/18
1
15
11/18/2008 12:02:42 AM

Accepted Answer

Restore the whole database to another machine (or temporary database), then copy the table seems like the easiest to me.

2008/11/18
21
11/18/2008 12:05:36 AM


The unit of backup and recovery in SQL Server is the database (it is the outer boundary of referential integrity).

Red Gate has some pretty good tools for row-level restore (SQL Data Compare and SQL Backup), but they come at a price.

2008/11/18

Detach the current database then restore the database with the date of the tbl you need to a new location (make a sub folder) to put it in keep it separate from your production databases, then restore the database to that sub folder, when completed find the tbl you need and script it to a create script file save to a file, your done with the database delete it then reattached the original one, now scroll down to the tbl you want to restore and script it to a create file (this is a backup only) now delete the tbl, make sure your database is selected and the active one next load the the scripted file you just created with the other database in the query analyzer and run it, it should report successful now check to see if your tbl has been replaced. your done

2011/11/17

Source: https://stackoverflow.com/questions/297422
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]