SQL BACKUP DATABASE

SQL BACKUP DATABASE

Creating backups of your database is a critical task for any database administrator. Backups protect your data against accidental loss or corruption. The BACKUP DATABASE statement is used to create a full backup of an existing SQL database.


Syntax

The syntax for creating a backup varies between database systems.

SQL Server BACKUP DATABASE Syntax

BACKUP DATABASE database_name
TO DISK = 'file_path';

You can also create a differential backup, which only backs up the parts of the database that have changed since the last full backup.

BACKUP DATABASE database_name
TO DISK = 'file_path'
WITH DIFFERENTIAL;

Other Database Systems