Cloud Training (Online)

How to Create a Database Backup in SQL Server using SQL Scripts?

You can create a Database Backup in SQL Server easily by using the SQL Scripts.

Just specify the BACKUP DATABASE statement by simply specifying the name of the database to backup and the path where the backup should be created.

BACKUP DATABASE <database name>
WITH <Options>

The BACKUPDEVICE specifies the device used for backup operation. You can use DISK or TAPE option here.

The WITHspecifies various options like Compression, Description, Name for the backup set etc.

Below is a sample backup database statement used to back up the TEST database.

TO DISK = 'E:\TEST1.Bak'
Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.