Home > Ask the SQL Server Experts > Michael Hotek Questions & Answers > Repairing corrupt MDF files
Ask The SQL Server Expert: Questions & Answers
EMAIL THIS

Repairing corrupt MDF files

Michael Hotek EXPERT RESPONSE FROM: Michael Hotek

Pose a Question
Other SQL Server Categories
Meet all SQL Server Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 04 October 2004
I had to run a query to delete duplicate records. There was not enough room to perform the transaction due to limited disk space, and I did not like not having a backup of the data. We moved the data to a new disk (so I could do a backup and have room for the transaction log to grow), although we had a few problems reattaching the database due to a log file we deleted. After reattaching (four hours later), I tried to run a query and received the following error message:
Server: Msg 823, Level 24, State 2, Line 1
I/O error 23(Data error (cyclic redundancy check).) 
detected during read at offset 0x000000167b0000 in file
'F:MDFTriggerTrigger_Data.MDF'.
After much research, I discovered the issue is a corrupt block on the disk. I am now copying the files back to the original location. However, I fear that one of the MDF files is now corrupt. I know I am copying the corrupt data back too, but thought there may be utilities or methods of repairing the corrupt data? Have you any solutions you can offer to sort out this god forsaken mess?

>
EXPERT RESPONSE
Once you have copied it to a corrupt disk block, copying it back won't fix the problem. First run a DBCC on the database to determine where the problem is. If it is in an index, simply drop and recreate the index to clean it up. If it is in the table itself, you are going to have to pull out your backups at this point.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
Michael Hotek
Applying LDF file to MDF without turning it to .BAK first?
Procedure for finding last modified info?
Migrating poorly designed database to new, normalized one
Displaying decimal places in SQL Server 2000
Creating a DTS package
Extracting data without strings converted to strange characters
Money data type conversion issue using DTS
Any way to alias a call to functions?
Memory usage by different databases
Script to show permissions

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2005 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts