You may get a similar message when attempting to restore the database using the xp_restore_database sotre procedure::
RESTORE DATABASE is terminating abnormally.
The tail of the log for the database "northwind" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
the sotreprocedure need to have the REPLACE parameter added
Add the following parameter to your script:
@with = N'REPLACE',
In the GUI, this wold be the 'Overwrite th existing database' recovery option.
sample backup, restore scripts and result from the restore execution:
exec master.dbo.xp_backup_database
@database = N'northwind',
@backupname = N'northwind - Full Database Backup',
@compressionlevel = 4,
@filename = N'D:\Backup\destination\northwind.bak',
@init = 1 ,
@with = N'SKIP',
@with = N'STATS = 10'
GO
exec master.dbo.xp_restore_database @database = N'northwind' ,
@filename = N'D:\Backup\destination\northwind.bak',
@filenumber = 1,
@with = N'STATS = 10',
@affinity = 0,
@logging = 0
--results from running the xp_restore_database:
Msg 62301, Level 19, State 1, Line 0
SQL Server has returned a failure message to LiteSpeed which has prevented the operation from succeeding.
The following message is not a LiteSpeed message. Please refer to SQL Server books online or Microsoft technical support for a solution:
RESTORE DATABASE is terminating abnormally.
The tail of the log for the database "northwind" has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Modified script to correct:
exec master.dbo.xp_restore_database @database = N'northwind' ,
@filename = N'D:\Backup\destination\northwind,bak',
@filenumber = 1,
@with = N'REPLACE',
@with = N'STATS = 10',
@affinity = 0,
@logging = 0
© ALL RIGHTS RESERVED. Feedback Terms of Use Privacy Cookie Preference Center