How to Create Database Backup in SQL Server? – Learn Here

Admin | May 1st, 2019 | SQL Server

SQL Server is the most popular relational database management system for storing and retrieving data. When using a database, almost all users need to create SQL database backup to avoid a data loss problem. When users have a backup file (.bak) of SQL Server database, it is easy to restore data in SQL Server. This blog is all related to how a user can create database backup in SQL Server. Here, we will also discuss a complete solution of how to recover corrupted SQL Server Database from BAK file.

User Query

Hello, I am using MS SQL Server 2012 and looking for a solution to create a backup of SQL Server database. Can someone guide me on how to create SQL database backup? Please suggest me a reliable solution that will not lose or corrupt any data information.”
Mack Edison, USA

Backup SQL Database using T-SQL

Steps to create a full SQL database backup with Transact- SQL are as follows;

1. Execute the BACKUP DATABASE statement to create a complete backup of the database by specifying:

  • Name of the database to backup
  • The backup device where the full database is written
  • The Syntax for full Database backup is:

BACKUP DATABASE AdventureWorks
TO DISK = ‘C:\AdventureWorks.BAK’
GO
Add different Options to backup with Options

2. Specify one or more WITH options which include:

  • Description = {;text’|@text_variable }. Description signifies the free-form text of the backup set.
  • { COMPRESSION | NO_COMPRESSION }. Signifies whether backup compression is performed on this backup.
  • NAME = { backup_set_name | @backup_set_name_var }. Specifies the name of the backup set.

Similarly, there are more T-SQL database commands for differential backup.

Create Database Backup in SQL Server Using SSMS

  1. Open Microsoft Server Management Studio and connect to the SQL Server database engine
  2. Next, go to Object Explorer and click the Server Name to expand the Server tree
  3. Select the Database >> Right Click >> Tasks >> Back Up
  4. The Back Up database window will appear, select the backup type as Full
  5. Click on the Add button to select the destination and file name for the database backup file
  6. Select the folder for the backup file and enter the File Name with a .bak extension
  7. Click OK button to finish the backup of MS SQL Server Database.

Done! This is the complete process to create Database backup in SQL Server using SQL Server Management Studio and T-SQL. Now, lets know how to restore database from backup.

How to Restore BAK File in SQL Server Using SSMS?

  • Right Click on the Database >> Tasks >> Restore >> Database
  • Next, under the Source for restore select “From device” option and click the Browse button
  • In the Specify Window, click Add button
  • Select the .bak file and click OK
  • In Destination for restore section, select the database you want to restore. Select the .bak file you selected in the above step
  • In the left panel, click Options and select the Restore option and also select Recovery state option according to your need
  • Click OK button to start the process of restoring SQL database from the BAK file.

How to Restore SQL Server BAK File Which Got Corrupted?

When you create database backup in SQL Server and the backup file is in a healthy state, you can restore BAK file in SQL Server using SSMS. But if the SQL Server backup file is corrupted, you must opt for a third-party solution because there is no inbuilt utility to restore SQL Server Database from BAK file which is damaged. The SQL Server Backup Recovery Tool is the most reliable, efficient and instant solution to repair & restore database from .bak file.

Download the software on the Windows system by clicking on the below link:

Download Purchase Now

Steps to Repair and Restore BAK File are as follows;

Step 1. Click Open and browse to add the SQL .BAK file.

Add SQL BAK File

Step 2. Auto detect the SQL Server .bak file version or manually select the actual version.

Auto Detect SQL BAK File Version

Step 3. Click on Multiple Backup File Option to restore bak file in bulk

Restore Multiple .bak files

Step 4. Click on the Recover button to start the recovery of SQL Server corrupt backup file

Recovery of Corrupted BAK Files

Step 5. After finishing the recovery process, select the Export button.

Export BAK File In SQL Server

Step 6. Select the option:- Export to SQL Server Database or Export as SQL Server Compatible Scripts and fill all the required information

Restore BAK File to SQL Server Database

Step 7. Click on the Export button to export all the recovered data items to the SQL Server.

Restore SQL Database from BAK File

That’s how you restore BAK file in SQL Server using SQL Server Management Studio. Also, can easily restore SQL database from BAK file which is damaged using the professional software.

Best Features of SQL BAK File Repair & Restore Tool

Once you create database backup in SQL Server, the software offers multiple features to restore bak file and some of them are listed in the below section.

  • Supports to repair corrupt SQL backup file which contains MDF & NDF database files.
  • Works with all SQL Server versions such as SQL Server 2017, 2016, 2014, 2012, 2008, etc.
  • Provides a preview of database objects like tables, views, functions, etc. after recovery
  • Offers to restore SQL Server BAK file to a new database or existing database
  • Directly export recovered database objects to the SQL Server database or SQL scripts
  • No file size limitations to repair & restore corrupted MS SQL database backup file

Conclusion

Step by step method of how to create database backup in SQL Server and restore bak file using SSMS are discussed here. We also discussed how to restore SQL Server Database from BAK file which is in an unhealthy state using professional software.

Frequently Asked Questions

Can I restore corrupt backup file to the SQL Server database?

Unluckily no, you can.not restore corrupted BAK file. First you need to repair it using the SQL backup recovery tool and then restore them to the SQL database.

How can I Scheduled Automatic SQL Database Backup?

You can create backup of SQL database automatically by doing these steps:
Step 1. Open the SQL server Management Studio.
Step 2. Connect to the database and go to the Object Explorer
Step 3. Open the “Management” folder and locate the “Maintenance plan” folder. Then right-click on Maintenance Plan folder and select New Maintenance Plan
Step 4. Enter the name of the Maintenance Plan.
Step 5. Now double-click on the database task to set up the backup process and drag the element onto the right window.
Step 6. From the Object Explorer > SQL Server Agent > Jobs. Under the SQL Agent jobs, we may find the job that created automatically.
Step 7. Right-click on this job, and click Start job at Step