Backup and Restore the database in ASP.Net web application

Introduction

The Database can be backup for avoiding the lost of data, corrupted data in the sql server. It will generate the .bak file and it can be restored into the same database later.

Backup

The Back can be taken using the Backup command in the sql query window. There are two types of medium to back up data. It can be either Disk or Tape.

BACKUP database TO [Disk/Tape] Path

For example

In the connected sql server there will be many database. We need to select a database which needs to be backed up the data.

BACKUP Employees
TO DISK = 'D:EmployeesBackUpFile.bak'
GO 

Restore

The backed up database can be restored using the RESTORE command.

RESTORE database FROM [Disk/Tape] Path

For example

The Employees database the backup data and it can be restored from the path.

RESTORE 
Employees
FROM DISK = 'D:EmployeesBackUpFile.bak'
GO 

Screenshots of Web application

backup1.jpg
Restore.jpg

 

Ebook Download
View all
Learn
View all