Restore SQL Database From Backup File using SSMS and T-SQL
Introduction
In the previous article we have discussed how to create SQL Server database backup using SQL Server Management Studio and Transact-SQL. Now in this article we are going to discuss how to Restore SQL Database from Backup using SQL Server Management Studio and Transact-SQL.
Restore SQL Database From Backup File using SQL Server Management Studio
Open SQL Server Management Studio from the Start Menu and connect to the proper instance of the Database Engine. Click on the Database folder to expand the database tree and right click on the database, then select Tasks >Restore > and then click Database
From the Restore Database window, select From device option to locate the backup sets to restore.
From the Specify Backup window set File as a Backup media and then click on the Add button
Find the SQL backup file that you want to restore and click Ok button
Now under Select a page pane, click on Option.
In the Restore Options section, select any of the given options as per your requirement (not required)
From Restore the database file as grid, you can also specify the new restore destination to restore the database to a new location.
Select one of the following options for the Recovery state box which defines the status of database after restoration
Click on the Ok button to restore the database
Restore SQL Database from Backup Using Transact-SQL
Restore from T-SQL is another easy and simple method that avoids so many clicks over the screen
Restore a Full SQL Database Backup
You can restore SQL database from backup file using below T-SQL Code. It will automatically overwrite the database file if it was already exists.
Restore a Full SQL Database Backup with NORECOVERY
This option leaves the database in a restoring position even after the restoration has completed
Conclusion
A good, working backup is very important when it comes to recovering from maximum disasters. Although, the disaster can also be prevented by a good SQL Recovery Tool. In this blog post we have discussed how to restore SQL database from backup file in SQL Server using Management Studio and Transact-SQL