Backup Database for Sql Server

Itacen Sabacok | Dec 16, 2021

BACKUP DATABASE statement is used in SQL Server to create a full back up of an existing SQL database.

 1-- syntax
 2BACKUP DATABASE databasename
 3TO DISK='file-location';
 4
 5-- example
 6BACKUP DATABASE myDb
 7TO DISK='F:\Users\itacen\Desktop\myDb-24052022.bak';
 8
 9-- differential back up: only backs up the parts of the database that have changed since the last full database backup - like incremental backup
10BACKUP DATABASE myDb
11TO DISK='F:\Users\itacen\Desktop\myDb-24052022.bak'
12WITH DIFFERENTIAL;