--SQL2008清空日志文件(数据库和日志文件名一定要是原始文件名!!!)
USE [master]
GO
ALTER DATABASE DBData SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBData SET RECOVERY SIMPLE   --简单模式
GO
USE DBData
GO
DBCC SHRINKFILE (N'DBData_Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE DBData SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DBData SET RECOVERY FULL  --还原为完全模式
GO

05-11 13:21