How to Recover SQL Server Database

Simple process to know how to recover SQL MDF components like Tables, Triggers, Functions, Stored Procedures, Views & Rules as well as user defined data types via SysTools SQL Recovery Tool.

Quick SQL RECOVERY

STEP 1

Go to Start Menu » Programs » SysTools® SQL Recovery Software » SysTools® SQL Recovery Software. The following screen will appear after that:

sql recovery


STEP 2

Open MDF File

From the software menu, click on “Open” to browse and open the desired MDF file from its location:

open


STEP 3

Select Quick Scan for normal corruption of database files.
This option can be opted for scanning MDF files faster.
Check the Auto detect option, if you want to detect the SQL Server version of your MDF file automatically:

Quick scan mode


STEP 4

The SQL Recovery Software will display the scanning report after performing Quick Scan operation on MDF file.

 Quick scan report


STEP 5

Software will prompt a note for Quick Scan results and recommend to use Advance scan if the expected results not found by Quick Scan

scan completed note


ADVANCE (CUSTOMIZED) RECOVERY

STEP 1

Go to Start Menu » Programs » SysTools® SQL Recovery Software » SysTools® SQL Recovery Software. The following screen will appear after that:

sql recovery


STEP 2

Open MDF File

From the software menu, click on “Open” to browse and open the desired MDF file from its location:

open


STEP 3

Browse MDF Files

Now, select the damaged MDF file and click on “Open”.

open mdf file


STEP 4

Select Advance Scan for Highly corrupted database files (MDF/NDF).
Check the Auto detect option, if you want to detect the SQL Server version of your MDF file automatically:

scan mode


STEP 5

You can also select the SQL Server Version of your MDF File manually.

Note: Selecting the wrong version may result in inconsistency.

sql version


STEP 6

Select NDF Options which is the second tab. select the first radio button to detect NDF file automatically:

Important Note: The NDF file must be associated with the Primary database, i.e., the selected MDF file.

sql version


STEP 7

Choose the second radio button to add NDF files manually, Then Click on Add Files / Add Folder option to add the NDF files to be recovered.

choose ndf file


STEP 8

After selecting the NDF file, i.e. secondary file of SQL server. Click OK:

open ndf file


STEP 9

The software will show a summarized detail of the selected MDF files and an automatic scanning of the MDF files of SQL Server database will take place.

scanning process completed



STEP 10

You can also save the MDF file scanning in .str file. If you want to save .str file, then click on "Yes" button given on the prompt screen, otherwise click onNo.

yes


STEP 11

Select the location for saving .str file and click on Save:

save str file


STEP 12

Preview Database Items

Preview recovered database of MDF and NDF files: Software will show the entire contents of the repaired MDF and NDF files such as; tables, triggers, stored procedures, views, etc.

preview sql data


STEP 13

Export MDF or NDF File

There will be a display of all the tables, triggers, and all the other elements. Click on Export to begin exporting recovered database.

export mdf data


STEP 14

Export Option

To export the database, select an output format for saving the exported database as:
You can choose among the following options:

(1) SQL Server Database 

(2) SQL Server Compatible Scripts

export-option


STEP 15

Export As SQL Server Database


 Enter the SQL Server Name and Select the Windows Authentication , if you are using this Authentication Mode to access your database.

Windows Authentication

If you are using SQL Server Authentication then enter the SQL Server Name and Login Creadentials for SQL Server

SQL Server Authentication


STEP 16

Select Create New Database to export recovered data on it or Choose Export to Existing Database to Overwrite the recovered database on an Existing database.

select destination to export

STEP 17

Create New Database


Software provides the option to export the recovered data by creating a new database. Just type the Database Name, which has not been already created in your SQL Server databases.

provide database name


STEP 18

Now, Click on check box to export the desired components of database

select desired components


STEP 19

Choose either of the options: export the MDF file With Only Schema or With Schema & Data.

export schema options


If you save the database components (tables/views/Procedures) with only schema then the software will export the schema/structure of selected database components.

export only schema


Next, the software will confirms the data to be exported with only schema option

export with schema confirmation


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK:

export completed


The software will show the status of exported records. Click on Close.

export status


software ask you to export the detail to a .csv file. Click on Yes.

export to csv


Browse the folder to save the .csv file or you can also make a folder to export the .csv file detail.

save csv file


you can check the .csv file detail by opening it.

check csv detail


you can also view the recovered database by expanding the databases in SQL Server.

view recovered database



STEP 20

If you want to save the database components with both schema and data then select With Schema & Data and Click on Export, the software will export the schema with the data of selected components.

export schema with data


Next, the software will ask you to export deleted record as well. Click on Yes.

export deleted records


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK:

export completed records



The software will show the status of exported records. Click on Close.

export status records


software ask you to export the detail to a .csv file. Click on Yes.

export to csv


Browse the folder to save the .csv file or you can also make a folder to export the .csv file detail.

save csv file


you can check the .csv file detail by opening it.

check csv file detail


To check recovered database on SQL Server just expand the databases.

view recovered components


STEP 17

Export to Existing Database


 This option will allow you to export the database to an existing database. Once the Server Name and Authentication fullfilled successfully, you just need to fetch the database on which you want to overwrite the recovered database.


export to existing database



STEP 18

Once the Database fetched successfully, then just select the database components by checking or unchecking them.

select sql components


STEP 19

Next, Choose either of the options: export the MDF file With Only Schema or With Schema & Data.

export schema options


If you save the database components (tables/views/Procedures) with only schema then the software will export the schema/structure of selected database components.

export with schema


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK

export completed records



The software will show the status of exported records. Click on Close.

export status records


software ask you to export the detail to a .csv file. Click on Yes.

export to csv


Browse the folder to save the .csv file or you can also make a folder to export the .csv file detail.

save csv file


you can check the .csv file detail by opening it.

check csv file detail


To check recovered database on SQL Server just expand the databases..

query recovered structure of objects



STEP 20

If you want to save the database components with both schema and data then select With Schema & Data and Click on Export, the software will export the schema with the data of selected components.

export schema with data


Next, the software will ask you to export deleted record as well. Click on Yes.

export deleted records


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK:

export completed records



The software will show the status of exported records. Click on Close.

export status records


software ask you to export the detail to a .csv file. Click on Yes.

export to csv


Browse the folder to save the .csv file or you can also make a folder to export the .csv file detail.

save csv file


you can check the .csv file detail by opening it.

check csv file detail


To check recovered database on SQL Server just expand the databases.

view recovered components


STEP 15

Export as SQL Server Compatible Script


A .sql file will get created if you choose to export & save the file as SQL Server Compatible SQL Script.

export to compatible script

STEP 16

Now check the desired components to be exported from the recovered database.

select database components
STEP 17

Next, Choose either of the options: export the MDF file With Only Schema or With Schema & Data.

export schema options


If you save the database components (tables/views/Procedures) with only schema then the software will export the schema/structure of selected database components.

export with schema


Next, the software will confirms the data to be exported with only schema option

export with schema confirmation


Browse the location to save .sql file

Browse location for .sql file


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK

export completed records


After the completion of the recovery process, the software will let you know about the completion process. Click on Close:

close detail


Navigate from location where you saved recovered SQL database.

explore .sql files



STEP 18

If you want to save the database components with both schema and data then select With Schema & Data and Click on Export, the software will export the schema with the data of selected components.

export schema with data


Next, the software will ask you to export deleted record as well. Click on Yes.

export deleted records


Browse the location to save .sql file

Browse location for .sql file


An 'Export Completed' window will appear on screen confirming the successful export of the database. Click on OK:

export completed records



After the completion of the recovery process, the software will let you know about the completion process. Click on Close:

close detail of export


Navigate from location where you saved recovered SQL database.

view exported scripts



Free Download SQL Recovery Software Download