Discussion Locked

corrupted MDF files

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
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?

3 replies

by shivaniinfo31

Hi,
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.

by guptamahima40

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.

by sagarleo1

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.

This discussion is closed to new replies.