The SQL Server2008 database was restored with the following error message:System.Data.SqlClient.SqlError: Database < database name > log trailer has not been backed up. If the log contains work that you do not want to lose, use BACKUP log with NORECOVERY to back up the log. Use the with REPLACE or with STOPAT clause of the RESTORE statement to overwrite only the contents of the log. (MICROSOFT.SQLSERVER.SMO)
After online access to the data, there are two ways to solve, only need to use one of the following two methods when restoring:
1. When restoring the database, click on the option on the Select page, tick overwrite existing database (with REPLACE), click OK to restore the database successfully (recommend this method).
2, when the restore operation, click the option on the Select page, tick keep the source database in the restoring state (BACKUP LOG with NORECOVERY), can solve the problem.
From the error message we can see that this problem occurs mainly when the restore operation, the SQL Server database is written to the log, resulting in an operation conflict. Both of the above methods resolve issues that have not yet backed up the tail of the database log.
Solution for "System.Data.SqlClient.SqlError: Log tail of database not yet backed up" error appears