Empty Space
  • Home
  • Resume
  • Posts
  • Personal
  • Code
Sign in Subscribe
code

Force clean database log files MS SQL

  • Robin Michael

Robin Michael

05 Apr 2017
Share

The interactive tools are not working, but this script will clear a stubborn log file that won't release.

Link here

http://stackoverflow.com/questions/56628/how-do-you-clear-the-sql-server-transaction-log

Assumption: You are in simple mode

USE TheDatabase;
GO

CHECKPOINT;
GO

CHECKPOINT; -- run twice to ensure file wrap-around
GO

DBCC SHRINKFILE(TheDatabase_Logical_Name, 5); -- unit is set in MBs
GO;

Sign up for more like this.

Enter your email
Subscribe

SNS Message parser

Parsing SNS messages from AWS drop in class parser. Getting to the point of using a class object to perform the action as follows with SNSParser() as p: results = p.extract_message(event=input_event) The contents of the message above is dependent on your input structure which you can
06 Sep 2026 3 min read

Serializing Dataclasses

As I am working with dataclass and wanting to return the values in a simplified serialized format that AWS Lambda and other brittle response wrappers can handle. Lambda is able to handle the base class of dict[str, str] as serializable, I wrote this helper method to perform recursive serialization.
30 Aug 2026 2 min read

Environment Settings, overload helper

I am working with environment variables because the current application I am building is a 12 factor application adherent and while messing with the .env files and or actual os/user environment variables it can get a bit confusing so I wrote this helper class to load the application variables
26 Aug 2026 1 min read
Empty Space © 2026
Powered by Ghost