Search
Home
Articles
Backup
Books
Certification
FAQ
Products
Replication
Scripts
Seminars
Training
TSQL

MSDN Fourms
Fort Worth SSUG
Oklahoma City SSDG

Resume

Champion Valley Pens

6.5 Disaster Recovery Plan 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Corrupt table

The usual type of corruption for a table is mentioned above in cross-linked objects. Another type of corruption that frequently occurs is a 2540 error on a DBCC. This is also explained and noted above. If neither of these errors are occurring and the table is still corrupt, there are a few things you can do.

Attempt to BCP all of the data out. If this works, you can drop and recreate the table. Once the table is recreated, BCP the data back in. If the data won't BCP out or the table won't drop go on to the next two suggestions.

  1. If replication is installed, stop replication
  2. Place the database in dbo use only mode
  3. BCP the data to a file
  4. Generate a script for the table
  5. Drop and recreate the table
  6. BCP the data in
  7. Run a dbcc checktable(<table name>) to verify integrity
  8. Take the database out of dbo use only mode
  9. If replication is installed, remove replication for that database
  10. If the database is replicated, verify all replication components have been eliminated
  11. If the database is replicated, reinstall replication
  12. If the database is replicated, verify and test installation of all components
  13. Perform a full backup of the database

Restore the most recent backup to another server and apply all transaction logs. Drop and recreate the corrupt table. Use Transfer Manager or BCP to move the data back into the production server. You have to make sure that the data is completely up to date and no other transactions are being processed in order to protect you from primary/foreign key violations. If the table won't drop, then go on to the next suggestion.

  1. If replication is installed, stop replication
  2. Place the database in dbo use only mode
  3. Restore the most recent backup to another server
  4. Run a dbcc checktable(<table name>) to verify the integrity of the table
  5. Using Transfer Manager, transfer the table to the production server
  6. Run a dbcc checktable(<table name>) to verify integrity
  7. Take the database out of dbo use only mode
  8. If replication is installed, remove replication for that database
  9. If the database is replicated, verify all replication components have been eliminated
  10. If the database is replicated, reinstall replication
  11. If the database is replicated, verify and test installation of all components
  12. Perform a full backup of the database

6.5 Disaster Recovery Plan 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Michael R. Hotek

All content on this site, except where noted, represents an original work of Michael R. Hotek and is protected by applicable copyright laws. The SQL Server FAQ is the sole work of Neil Pike. No page, portion of a page, or download may be used for commercial purposes in whole or in part without the express, written permission of the applicable author.