Thursday, December 3, 2020

How to Shrink SQL Server Database Log File Size using DBCC Command

 

 

How to Shrink SQL Server Database Log File Size using DBCC Command

you must take a full backup of your database before executing the following: 

 

ALTER DATABASE <YOUR DATABASE NAME>
SET RECOVERY SIMPLE
GO
DBCC SHRINKFILE (<YOUR DATABASE LOG FILE NAME>, TARGET SIZE IN MB)
GO
ALTER DATABASE <YOUR DATABASE NAME>
SET RECOVERY FULL