注意:以下语句非常危险
--BACKUP LOG MyDb TO DISK='NUL:'
顺便压缩文件:
Use MyDb
DBCC SHRINKFILE (Logical_File_Name, Shrink_To_MB);
GO
获取Logical Name的方法:
SELECT d.name DatabaseName, f.name LogicalName,
f.physical_name AS PhysicalName,
f.type_desc TypeofFile
FROM sys.master_files f
INNER JOIN sys.databases d ON d.database_id = f.database_id
GO