SQL Server 2008 清空删除日志文件
USE [master]
GO
ALTER DATABASE STAR9SQL SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE STAR9SQL SET RECOVERY SIMPLE --简单模式
GO
USE star9sql
GO
DBCC SHRINKFILE (N'STAR9SQL_log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE STAR9SQL SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE STAR9SQL SET RECOVERY FULL --还原为完全模式
GO
//如果不知道日子文件名在sys.database_files里是什么名字的话,可以用以下注释的语句进行查询
//USE STAR9SQL
//GO
//SELECT file_id, name FROM sys.database_files;