清除数据库日志

--先查询出日志名:

use [VTS_ReckoningCounterV5.0]
select name,size from sys.database_files
alter database [VTS_ReckoningCounterV5.0] set recovery simple with NO_WAIT
alter database [VTS_ReckoningCounterV5.0] set recovery simple
--清除日志
use [VTS_ReckoningCounterV5.0]
dbcc shrinkfile ('VTS_ReckoningCounter_log',0,truncateonly)
alter database [VTS_ReckoningCounterV5.0] set recovery full with NO_WAIT
alter database [VTS_ReckoningCounterV5.0] set recovery full

原文地址:https://www.cnblogs.com/ylemzhang/p/2859585.html