SQL Server 2008 Backup Log Truncate Only

The BACKUP LOG database_name WITH TRUNCATE ONLY is gone in SQL 2008.

Instead the requirement is to change the recovery mode of the database to simple. Then shrink the log file, then set the recovery model back to the original state.

ALTER DATABASE database_name SET RECOVERY SIMPLE

go

DBCC SHRINKFILE(database_name_log)

go

ALTER DATABASE database_name SET RECOVERY FULL

go

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s