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

sed: Remove lines

I wanted to remove the first and last lines of a text file that ends each line with a newline. This is because there are delimiters that are unnecessary to processing of the file. I suggest you use sed Example input File Start Important line 1 Important line 2 File
22 Feb 2026

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
Empty Space © 2026
Powered by Ghost