Thursday, November 28, 2013

Restoring Database by Query and Management Studio in SQL Server

Database Restoring is a frequently used approach that developers use to return data to its original condition from which the backup file created. Restoring Database is very easy and simple process. Here are two ways by which you can restore your backup file.

Just create a blank Database namely "MyDatabase"
Restore Database by Query:-
                USE master
RESTORE DATABASE MyDatabase
FROM DISK = 'C:\MyDatabase_Backup.bak'
WITH REPLACE



You can also do the same by using Sql Server Management Studio.
Follow some of the steps to Restore Database Successfully.


Then Click on “From Device” radio button



Select the path where Database backup exists.

Click on the checkbox to Restore.


Then Click on “Options” in the left pane.
Click the following CheckBoxes:-
è Overwrite the existing database(WITH REPLACE)
è Preserve the replication settings(WITH KEEP_REPLICATION)
è Prompt before restoring each backup


Then Click on “OK”


The restore of database “MyDatabase” completed successfully.
Then Click on “OK”.







No comments:

Post a Comment