Categories
Server

How to purge transaction log file in SQL Server

  1. Open SQL Management Studio
  2. Right click Database
  3. Select “New Query”
  4. Type below SQL script

ALTER DATABASE DBName SET RECOVERY SIMPLE

GO

DBCC SHRINKFILE (XXXX_log, 5)

GO

ALTER DBName dw SET RECOVERY FULL

GO

4. Run “Execute”