How to Perform Tail Log Backup During SQL Server Restore

restoresql servertransaction-log

Typically when doing a restore of a DB from a production server to a non-production server I will use the WITH REPLACE option as when I forget I get an error about the tail log not being backed up.

According to MSDN I should indeed be backing up my tail log before restoring:

If the database is online and you plan to perform a restore operation on the database, begin by backing up the tail of the log. To avoid an error for an online database, you must use the … WITH NORECOVERY option of the BACKUP Transact-SQL statement.

What are some dangers or disadvantages of the way I'm doing it? Why is backing up the tail log first of advantage to me?

I'm using SQL Server 2008R2 but I'm presuming this query will be relevant to most newer versions of SQL Server also so have not tagged it as such initially.

Best Answer

If you don't back up the tail of the log you lose any transactions that ocurred since you last backed up the database.