How to apply a transaction log backup (Transact-SQL)

To apply a transaction log backup


Important The system administrator restoring the transaction log must be the only person currently using the database where the transaction log will be applied.

It is not possible to apply a transaction log backup:


  1. Execute the RESTORE LOG statement to apply the transaction log backup, specifying:
  2. Repeat Step 1 for each transaction log backup you need to apply.
Examples
A. Applying a single transaction log backup

This example applies a transaction log backup to the MyNwind database.

RESTORE LOG MyNwind

    FROM MyNwind_log1

    WITH RECOVERY

GO

  

B. Applying multiple transaction log backups

This example applies multiple transaction log backups to the MyNwind database.

RESTORE LOG MyNwind

    FROM MyNwind_log1

    WITH NORECOVERY

GO

RESTORE LOG MyNwind

    FROM MyNwind_log2

    WITH NORECOVERY

GO

RESTORE LOG MyNwind

    FROM MyNwind_log3

    WITH RECOVERY

GO

  

See Also
Creating and Applying Transaction Log Backups RESTORE
Using Differential Database Backups with Transaction Log Backups Restoring File or Filegroup Backups

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.