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>
TO BACKUPDEVICE <Path>
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.

USE TEST;
GO
BACKUP DATABASE TEST
TO DISK = 'E:\TEST1.Bak'

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

When dealing with a relational database management system (RDBMS) like SQL Server, compatibility level is an important concept to understand....
In this blog post, let’s learn about the error message “49975 – Unable to load controller client certificate due to...
In this blog post, let’s learn about the error message “49973 – Cannot remove tempdb remote file to local tempdb...