USE 資料庫名;
GO
— Truncate the log by changing the database recovery model to SIMPLE.(簡易模式)
ALTER DATABASE 資料庫名 SET RECOVERY SIMPLE;
GO
— Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (log檔別名, 1);
GO
— Reset the database recovery model.(完整模式)
ALTER DATABASE 資料庫名 SET RECOVERY FULL;
GO