Method 1,
In the current database, select fileid, groupid, name from sysfiles where groupid = 0 then. The following results are obtained: fileid groupid name 2 0 test_log and above. fileid is the log file ID and name is test_log.
-- In the query analyzer, select the database for which logs are to be cleared and execute the following SQL
Backup log database name with no_log
DBCC shrinkfile (Log File Name or log file ID, the target size to be reduced)
For example:
Backup log test with no_log
DBCC shrinkfile (2, 2)
Or
Backup log test with no_log
DBCC SHRINKFILE ('test_log',10) If you do not want it to become larger, right-click the database and choose Properties> Options> fault recovery modelSimple ModelThat's it! Or use SQL statement alter database name set recovery simple method 2, SQL Server Enterprise Manager-> SQL Server group-> server-> database-select database entity-right-click-> All task-separate database, then, delete it in the physical path of the database. LDF file, right-click the database, and append all tasks to the database. Then, the log file is generated again.