General discussion


corrupted MDF files

Can anyone help me with how to view corrupted mdf files? I have certain MDF files which have been corrupted and creating hindrance in accessing SQL server database. I want to view these files. So, just wanted to know how to view them?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

fix MDF file

by shivaniinfo31 Spammer In reply to corrupted MDF files

In case there is a minor issue in the MDF file, then you can execute DBCC CHECKDB command. This inbuilt utility, which is free to use.

Collapse -

Open Corrupted MDF Files

by guptamahima40 In reply to corrupted MDF files

To open corrupted SQL MDF files, you can try any freeware open source program to view them. There are many, if you search them on Google. It cost nothing just a click and your problem is solved.

Collapse -

Steps to Repair Corrupted MDF File With DBCC CHECKDB

by sagarleo1 In reply to corrupted MDF files

First of all, you need to run DBCC CHECKDB on the corrupt SQL database by executing the following query:

DBCC CHECKDB (Name_of _corrupt _database)

Note: You can also define some options like no_infomsgs and infomsgs with DBCC CHECKDB.

After that, you need to check the index ID.

Case 1: If index ID > 1, drop it and create it again.

Case 2: If index ID is either 0 or 1, then run DBCC CHECKDB again with the appropriate repair options like repair_rebuild, repair_fast, or repair_allow_data_loss.

DBCC CHECK (name_of_corrupt_database, repair_fast)
DBCC CHECK (name_of_corrupt_database, repair_rebuild)
DBCC CHECK (name_of_corrupt_database, repair_allow_data_loss)

Now, to ensure zero corruption, execute DBCC CHECKDB and a message is displayed i.e. DBCC CHECKDB displays 0 allocation errors and 0 consistency errors in name_of_your_corrupt_database.

Related Discussions

Related Forums