Clearing the log in SQL Server must be done in simple mode, and then back to full mode when the purge action is complete.
*[databasename] The name of the database to compress the log.
Setting the database schema to Simple mode
ALTER DATABASE SET with no_wait ALTER DATABASE SET RECOVERY Simple
Querying log files for Filedid
SELECT * from Sysfiles
Fill in the Filedid of the log with the first argument in parentheses in the following statement, where the second parameter refers to how many megabytes (M) the log is compressed
--Log will be compressed to 100M after execution
DBCC Shrinkfile (2,+)
Revert to Full mode
ALTER DATABASE SET Full with no_wait ALTER DATABASE SET Full
Advantages: This cleanup log runs short of time, 90GB of log can be cleared in minutes or so, after the completion of a complete preparation-the part can be completed within minutes.
Cons: But this action is best not to be used frequently, as it will result in system fragmentation. Backup of log and diff in normal state--logs can be truncated.
SQL Server 2008 versions of the applicable statements
BACKUP LOG [DataBaseName] with no_log DBCC Shrinkdatabase ([DataBaseName], truncateonly)
SQL Server log cleanup