How to create a transaction log backup (Transact-SQL)
To create a transaction log backup
Important The transaction log should not be backed up:
- If the trunc. log on chkpt. database option is set to TRUE; create a database or differential database backup instead.
- If any nonlogged operations have occurred in the database after the last database backup was created. Create a database or differential database backup instead.
- Until a database backup has been created, because the transaction log contains the changes made to the database after the last database backup was created.
- If the transaction log has been truncated, unless a database or differential database backup is created after the transaction log truncation occurs.
- If any files are added or deleted from the database; a database backup should be immediately created instead.
- Execute the BACKUP LOG statement to back up the transaction log, specifying:
- The name of the database to which the transaction log to back up belongs.
- The backup device where the transaction log backup will be written.
- Optionally, specify:
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 transaction log backup for the MyNwind database to the previously created named backup device MyNwind_log1.
BACKUP LOG MyNwind
TO MyNwind_log1
GO
See Also
(c) 1988-98 Microsoft Corporation. All Rights Reserved.