SQL SERVER – SHRINKFILE and TRUNCATE Log File in SQL Server 2008

We just upgraded to SQL Server 2008. One of our jobs failed as it was using the following code.

The error was:

Msg 155, Level 15, State 1, Line 1
 ‘TRUNCATE_ONLY’ is not a recognized BACKUP option.

The code was:

DBCC SHRINKFILE(TestDBLog, 1)
 BACKUP LOG TestDB WITH TRUNCATE_ONLY
 DBCC SHRINKFILE(TestDBLog, 1)
 GO
I have modified that code to subsequent code and it works fine. But, are there other suggestions you have at the moment?

USE [master]
 GO
 ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
 DBCC SHRINKFILE(TestDbLog, 1)
 ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
 GO

Configuration of our server and system is as follows:

[Removed not relevant data]“

Comments