Friday, May 11, 2018

How to shrink SQL Server Transaction Log file in MS SQL Server 2012

On Transact-SQL Window, run the below statement;

ALTER DATABASE MyDatabaseName SET RECOVERY SIMPLE        
DBCC SHRINKFILE (MyDatabaseName_Log, 1) 
Go                  


Once the Log File has been truncated, run the below command to put it back the database into full recovery mode using below statement;

ALTER DATABASE MyDatabaseName SET RECOVERY FULL        
GO                                         

No comments:

Post a Comment

Business Central SaaS Extension Design: Implementing Plant Tracking with AL Event Subscribers

  Extending Business Central SaaS: Plant Tracking Using AL Extensions  1️⃣ Problem Statement In many manufacturing and service-oriented or...