Whenever a database file of Microsoft SQL Server becomes inaccessible due to corruption, you have two options in order to repair SQL database files: Microsoft SQL Server Management Studio Express to issue some repair commands through the query editor, and a third-party recovery tool to recover data from corrupt database of SQL Server.
Using Microsoft SQL Server Management Studio Express is a manual procedure to repair the database file by following some commands. To execute the manual trick, first of all you need to download the Microsoft SQL Server Management Studio Express and install it on your system (if you don’t have it). Once it is installed on your system, follow the steps given below:
Step 1: Launch Microsoft SQL Server Management Studio Express on your system. Go to Start > Programs > Microsoft SQL Server 2005/2008 > SQL Server Management Studio Express.
Step 2: Log into the database using Windows Authentication.
Step 3: Now expand the database. Right-click on wt_sched and choose Properties.
Step 4: Select Options and scroll to the bottom in the right hand side pane.
Step 5: Change Restrict Access to SINGLE_USER.
Step 6: Click OK and repeat the above steps for the wtMaster section of the database.
Step 7: Select New Query from the toolbar. In the query pane, enter the following commands:
dbcc checkdb(‘wtMaster’,REPAIR_REBUILD)
dbcc checkdb(‘wt_sched’,REPAIR_REBUILD)
Step 8: Now select the Execute button to repair the database.
Step 9: Perform the steps outlined in 5-7 above and change the databases back to MULTI_USER from SINGLE_USER.
Note: As you are changing the database back to MULTI_USER mode, you may require to log out and log back in using SQL Server Management Studio Express. This is action mandatory in order to change both parts back to their original settings. If an error message appear saying there are too many connections while attempting to make these changes, you can close the Management Studio and then open it again. Doing this will allow the changes to take effect.
If the above trick fails to repair SQL database, then you can take help of an advanced recovery tool that can fix corrupt SQL database files and recover your crucial data from them. Try smart SQL Database Recovery tool of Data Recovery Solutions to perform maximum possible recovery from corrupt SQL database files.