First time here? Check out the FAQ!
x

Repairing a MDF file.

0 votes
asked by (120 points)
edited by

I have 2 databases with 50GB each with very crucial data, now the SQL is telling me that both are corrupted. Is there any way to repair? I have run some SQL commands that I found on the Internet but nothing is fixing the problem.

2 Answers

0 votes
answered by (264k points)
edited by

There is an SQL query you can try:

ALTER DATABASE databasename
SET emergency
GO
ALTER DATABASE databasename
SET singleuser
GO
DBCC checkdb (databasename, repair
allowdataloss)
ALTER DATABASE databasename
SET multi_user
GO

You can use the following code to try a possible repair. I have seen that there are many applications who might be able to repair it, but I wouldn't trust them since they're too expensive.

0 votes
answered by (460 points)

If you are looking software for MDF file repair, you can try best SQL Database Repair software that allows easily fix all issue from the corrupted MDF file and extract database easily.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register
...