SQL Server 2008 清除日志
USE [master]
GO
ALTER DATABASE [DBNAME] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [DBNAME] SET RECOVERY SIMPLE --简单模式
GO
USE [DBNAME]
GO
DBCC SHRINKFILE (N'[LOGNAME]' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [DBNAME] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [DBNAME] SET RECOVERY FULL --还原为完全模式
GO
-------------------说明-------------------------
--[DBNAME] 为数据库名称
--[LOGNAME] 获取方法
USE [DBNAME]
select * from sys.database_files