Export (0) Print
Expand All

How to create a differential database backup (Transact-SQL)

SQL Server 2000

How to create a differential database backup (Transact-SQL)

To create a differential database backup

Important  It is not possible to create a differential database backup unless the database has been backed up first.

  1. Execute the BACKUP DATABASE statement to create the differential database backup, specifying:
    • The name of the database to back up.

    • The backup device where the database backup will be written.

    • The DIFFERENTIAL clause, to specify that only the parts of the database that have changed after the last database backup was created are backed up.
  2. Optionally, specify:
    • The INIT clause to overwrite the backup media, and write the backup as the first file on the backup media. If no existing media header exists, one is automatically written.

    • The SKIP and INIT clauses to overwrite the backup media even if there are either backups on the backup media that have not yet expired, or the media name does not match the name on the backup media.

    • The FORMAT clause when using media for the first time to completely initialize the backup media and rewrite any existing media header.

      The INIT clause is not required if the FORMAT clause is specified.

Important  Use extreme caution when using the FORMAT or INIT clauses of the BACKUP statement as this will destroy any backups previously stored on the backup media.

Examples

This example creates a full and a differential database backup for the MyNwind database.

-- Create a full database backup first.
BACKUP DATABASE MyNwind 
   TO MyNwind_1 
   WITH INIT
GO
-- Time elapses.
-- Create a differential database backup, appending the backup
-- to the backup device containing the database backup.
BACKUP DATABASE MyNwind
   TO MyNwind_1
   WITH DIFFERENTIAL
GO

See Also

BACKUP

Differential Database Backups

Reducing Recovery Times

Show:
© 2015 Microsoft