# Database Discussions > Microsoft SQL Server 2008 >  Cannot Start MSSQL Error Code 3 (Corrupt MASTER.MDF)

## busting

Afternoon All MSSQL Experts

We run a MRP package called PREDCOM that uses MSSQL as a db. Since of this morning we cannot start the db service. The error message indicates that the master.mdf file is corrupt. Can anybody assist us to restore the database without losing the table definitions, stored procedures and data.

Thanks

----------


## rmiao

Error says master db corrupted, it shouldn't affect mrp db. Do you have good backup of master db and mrp db? Is there any disk related error in windows event logs? If so, fix disk issue and reboot machine. Otherwise you can try restore master db from backup. If still gives you erro, try restore mrp db to another sql server.

----------


## ted

Restore from the backup. this is the best way to secure your data.

----------


## daxtonbrown

One of the methods for restoring sql database via T-SQL, if guide below can't help you, take a look at more powerful methods

http://en.kioskea.net/forum/affich-7...ng-an-mdf-file
http://www.answerbag.com/polls/sql-d...z-help_3244311
https://sql.recoverytoolbox.com/ Recovery Toolbox for SQL Server

Restore With Transact-SQL
Step 1
Click New Query in the Management Studios main toolbar. This opens a large text area on the right side of the screen.
Step 2
Click in the text area and type a Create Database statement using the following Transact-SQL code as a guide:
CREATE DATABASE MyDatabase ON (FILENAME = 'c:\data files\my_data.mdf'), (FILENAME = ' c:\data files\my_data.ldf') FOR ATTACH;
Step 3
Click the Execute button in the Transact-SQL toolbar, located just under the Management Studios main toolbar. The Execute button symbol is a right-pointing triangle. SQL Server Management Studio restores the database.

----------


## SpywareDr

> https://sql.recoverytoolbox.com/ Recovery Toolbox for SQL Server


Recovery Toolbox - Terms of Use


> Recovery Toolbox does *not* bear any responsibility nor assumes any risks if by any reason a product or a service made available on this Web Site breaches national law of *any* state. 
> ...
> These Terms of Use and any disputed relating hereto shall be governed by and construed in accordance with the laws of the *Russian Federation* without regard to its principles of conflict of laws. You agree to the exclusive jurisdiction of the courts of the *Russian Federation* for any claim or cause of action arising out of, or relating to or in connection with these Terms of Use ...

----------

