How to Restore SQL Server Database From Backup?
Last Updated : 15 Oct, 2021
A Database is defined as a structured form of data that is stored database a computer or data in an organized manner and can be accessed in various ways. It is also the collection of schemas, tables, queries, views, etc. Databases help us with easily storing, accessing, and manipulating data held on a computer. The Database Management System allows a user to interact with the database. In this article, we will see how can we restore SQL Server Database from Backup.
For the demonstration purpose, we will create one database named 'geeks'.
Step 1: Create Database
Use the below SQL statement to create database called geeks;
QUERY:
CREATE DATABASE geeks;

you can see database with name 'geeks' is created.
Step 2: Use database
Query:
USE geeks;
Step 3: Table definition
We have the following demo_table in the database.
Query:
CREATE TABLE demo_table (FIRSTNAME varchar(20), LASTNAME varchar(20), GENDER varchar(10), AGE int);
Step 4: Insert values
Following command is used to insert values into the table.
Query:
INSERT INTO demo_table VALUES ('ROMY','KUMARI','FEMALE', 22), ('PUSHKAR', 'JHA', 'MALE', 23), ('SOUMYA', 'SHRIYA', 'FEMALE', 22), ('NIKHIL', 'KALRA', 'MALE', 23), ('ROHIT', 'KUMAR', 'MALE', 23),
Step 5: View data of the table
Query:
SELECT * FROM demo_table;
Output:

Restoring of database can be done through Object explorer in SQL Server.
Steps to restore database:
- Select View from menu bar.
- Select Object explorer option. Object explorer will be appeared on left side of the screen.
- Right click on Database folder and select 'Restore Database' option.
- The dialog box will open, select device option and browse the backup media.
- After selecting the Backup media, click OK
- Database will be restored successfully.
Now, for demonstration of restoring the database. Delete the geeks database.
Step 6: Delete the Database
Syntax:
DROP DATABASE database_name;
We can not drop the database while in use.
Query:
DROP DATABASE geeks;
Output:

geeks database is deleted. You can not find geeks database in the object explorer.
Step 7: Restore database
- Right click on database and select 'Restore database' option

- Select 'device' option and add backup media


- Prompt will appear showing the message as "Database restored successfully". Click OK.


'geeks' database is restored successfully.
Similar Reads
SQL Interview Questions Are you preparing for a SQL interview? SQL is a standard database language used for accessing and manipulating data in databases. It stands for Structured Query Language and was developed by IBM in the 1970's, SQL allows us to create, read, update, and delete data with simple yet effective commands.
15+ min read
SQL Tutorial Structured Query Language (SQL) is the standard language used to interact with relational databases. Whether you want to create, delete, update or read data, SQL provides the structure and commands to perform these operations. SQL is widely supported across various database systems like MySQL, Oracl
8 min read
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
SQL Commands | DDL, DQL, DML, DCL and TCL Commands SQL commands are crucial for managing databases effectively. These commands are divided into categories such as Data Definition Language (DDL), Data Manipulation Language (DML), Data Control Language (DCL), Data Query Language (DQL), and Transaction Control Language (TCL). In this article, we will e
7 min read
SQL Joins (Inner, Left, Right and Full Join) SQL joins are fundamental tools for combining data from multiple tables in relational databases. Joins allow efficient data retrieval, which is essential for generating meaningful observations and solving complex business queries. Understanding SQL join types, such as INNER JOIN, LEFT JOIN, RIGHT JO
5 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
SQL Query Interview Questions SQL or Structured Query Language, is the standard language for managing and manipulating relational databases such as MySQL, Oracle, and PostgreSQL. It serves as a powerful tool for efficiently handling data whether retrieving specific data points, performing complex analysis, or modifying database
15+ min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read