SQL Server 2008 has been eliminated NO_LOG BACKUP command that could be useful to truncate the log files of large size.
BACKUP LOG [DatabaseName] WITH NO_LOG
Many developers need to compress the testing databases files to avoid getting the disk space used unnecessarily. By executing the following you can shrink to a minimum all the log files of a database server:
EXECUTE sp_msforeachdb
'USE ?;
ALTER DATABASE ? SET RECOVERY SIMPLE;
DECLARE @LogLogicalName nvarchar(100);
SELECT @LogLogicalName = file_name(2);
DBCC SHRINKFILE(@LogLogicalName, 100);
ALTER DATABASE ? SET RECOVERY FULL;'
“sp_msforeachdb” is a no-documented stored procedure that runs the script for all the db in your server.
Use with caution!
Alberto.