Promotic
WikipediaLinkedInYoutubeTwitterFacebook

BACKUP DATABASE - statement of language DB_MSSQL

Description:
Database backup.
Syntax:

BACKUP DATABASE database

  TO DISK | TAPE = physical_backup_device_name

  [ WITH

    [ DIFFERENTIAL ]

    [ [,] INIT | NOINIT ]

    [ [,] LOG ]

    [ [,] NAME = name ]

    [ [,] DESCRIPTION = description ]

    [ [,] PASSWORD = password ]

  ]

 
database Name of the backed up database.
physical_backup_device_name Name of the physical device for the backup (file or tape).
TO DISK Physical device for the backup is a file.
TO TAPE Physical device for the backup is a tape.
WITH Clause prefaces possible accessory backup parameters.
DIFFERENTIAL Flag of incremental backup (change from the last backup).
INIT Removing old backups on the device.
NOINIT Keeping old backups on the device and adding new backup at the end.
LOG Backup only transaction log.
name Name of the backup set.
description Description of the backup set.
password Password of the backup set (if stated, then it is required on restoring the database).
See also:
Example1:
Create the backup of the whole database 'pm_data' in the file while keeping possible old backups in this file.
BACKUP DATABASE pm_data TO DISK='c:\temp\pm_data.bak'
Example2:
Create the backup of the whole database 'pm_data' in the file while removing possible old backups in this file.
BACKUP DATABASE pm_data TO DISK='c:\temp\pm_data.bak' WITH INIT
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice