The HP Community is here for you.
05-08-2014 04:41 PM
It is better to provide the detailed symptom of your corrupt SQL Server database since the recovery process may be different from case to case. For example, you should list the error message generated by SQL Server.
You may refer to this post regarding similar discussions regarding SQL Server database recovery:
05-08-2014 11:15 PM
You can easily run DBCC CHECKDB command to simply recover mdf file from corrupted sql server database. But sql server doesn’t give any assurance to provide healthy or original data when you use this command.
Sometimes this command gets unable to recover .mdf file, then you can try third party tool. I have already used a third party tool to recover my suspect database and that is sql Recovery software. From here I downloaded it: http://www.sqlrepairtool.net
07-09-2014 01:35 AM
MDF files of SQL database may get corrupt due to some problem in the database. If such a situation arises, the user can use the software which recovers the lost MDF file. But before choosing the software, make sure that it is efficient enough to recover the unique keys, primary keys, indexes, stored procedures, views etc from your corrupt MDF file.
08-13-2014 03:12 AM - edited 08-13-2014 03:14 AM
11-20-2014 12:47 AM
Basic solution to recover MDF file from corruption is to run DBCC statements. It is a set of SQL statements -
1. Dbcc checkdb ('database_name') with no_infomsgs
You do not need to repair file if the above statement is executed without any errors. Before executing the repair operation, you need to set the database in single user mode by executing:
2. Alter database 'database_name' set SINGLE_USER
You can now start repairing process by using Repair_Rebuild model by executing:
3. Dbcc checkdb('database_name', REPAIR_REBUILD)
If this statement executes successfully, then execute 5.5 else execute:
4. Dbcc checkdb('database_name', REPAIR_ALLOW_DATA_LOSS)
This statement may lead to data loss. If it is executed properly then execute 5.5 else execute:
5. 5.1 Alter database 'database_name' set EMERGENCY
5.2 Alter database 'database_name' set SINGLE_USER
5.3 Dbcc checkdb ('database_name', REPAIR_ALLOW_DATA_LOSS) with no_infomsgs, all_errormsgs
5.4 Alter database 'database_name' set ONLINE
5.5 Alter database 'database_name' set MULTI_USER
Click here to get complete guide to repair MDF file.