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

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

GitHub Actions - Part 1

Starting a series of posts on working with GitHub Actions. One of the key things is that the yml inputs for an action has a variety of triggers, but when working on a workflow I suggest always starting with a way to manually trigger an action. For this you should
03 Feb 2026 2 min read

Python + React: Live Debugging

A few months ago I was presented with a surprise live debugging session in an interview that covered Python and React items. Both challenges were recorded and expected that I would handle with out any assistance. I did both, then they never responded after asking me if I had responded
01 Feb 2026 3 min read

macOS Base64 encode script

I am working on macOS and I wanted to base64 encode a snippet of json text. For example I have the following JSON snippet. { "array": [ 1, 2, 3 ], "boolean": true, "color": "gold", "null": null, "number": 123, "object&
13 Jan 2026 2 min read
Empty Space © 2026
Powered by Ghost