To restore to the point of failure
This example backs up the currently active transaction log of the MyNwind database, even though MyNwind is inaccessible, and then restores the database to the point of failure using previously created backups.
-- Back up the currently active transaction log.
BACKUP LOG MyNwind
TO MyNwind_log2
WITH NO_TRUNCATE
GO
-- Restore the database backup.
RESTORE DATABASE MyNwind
FROM MyNwind_1
WITH NORECOVERY
GO
-- Restore the first transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log1
WITH NORECOVERY
GO
-- Restore the final transaction log backup.
RESTORE LOG MyNwind
FROM MyNwind_log2
WITH RECOVERY
GO
RESTORE | Restoring a Database to a Prior State |