SQL Server 2008清空日志
USE [master];
GOALTER DATABASE OTMS SET RECOVERY SIMPLE WITH NO_WAIT;
GO
ALTER DATABASE OTMS SET RECOVERY SIMPLE;
GO
USE MyDb;
GO
DBCC SHRINKFILE (N'MyDb_log', 0, TRUNCATEONLY);
GO
USE master;
GO
ALTER DATABASE MyDb SET RECOVERY FULL WITH NO_WAIT;
GO
ALTER DATABASE MyDb SET RECOVERY FULL;
GO
USE MyDb;
GO
SELECT name FROM SYS.database_files WHERE type_desc = 'LOG';