Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3824
  • Last Modified:

How do I restore a single table in SQL SERVER 2005?

If I have just one corrupt table in a database and I only want to restore one table is this possible either through a script or a function in SQL SERVER MGMT STUDIO?
1 Solution
No can do....Need to restore the db to another db w/ a different name and move the table over.
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I agree.

unless that table was the only one in it's dedicated filegroup ...
but that's unlikely here, otherwise you would know how to restore that also.
>>unless that table was the only one in it's dedicated filegroup ...

I almost wrote that, but then the reasoning from your last sentence kicked in for me.  :)
it depends. SQL Server 2005 introduced ability to restore a specific "page" from SQL Server 2005 backup, and it would be fun to write a script to restore a table by restoring piece meal pages out of backup.

Chances are you do not need to restore the table, if all you need is to make sure that table corruption goes away. In addition there is always dbcc checktable, technet link: http://technet.microsoft.com/en-us/library/ms174338(SQL.90).aspx

In addition if by chance you are using backup tools, such as SQL LiteSpeed from Quest it has built - in ability to restore specific table.
We use SQL LiteSpeed from Quest for that reason.  Also, because of good compression ability.

One last option is to restore the entire database to a different server or as a different dbname on the same server and copy the table from the resored database to your production database.
This option will work if you have disk space available.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now