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

Longest continuous ranges in a list of integers

Presented with this convoluted description of a problem to solve, but simplified to the following: 💡Given an unsorted list of integers with duplicates find the longest incrementing range of numbers As in find_max_continuous_range([1, 1, 0, 6, 3, 5, 5, 4]) is the range [3,4,5,
20 Dec 2025 3 min read

Ersatz Thinking

To learn and understand something you need to encounter challenge or friction just like lifting weights you should lift on a progressive overload to build strength or training to run a marathon you must build up your aerobic base over time with increased training distances and durations. That Large Language
22 Nov 2025 1 min read

MySql 8.0 LTS to 8.4 LTS

This blog requires multiple software components and one of them is MySql which I have been upgrading over time of the original install of MySql 5 and now it is on 8.0. This transition has not been easy or straightforward because of the change to utfmb4 was a huge
16 Nov 2025 2 min read
Empty Space © 2025
Powered by Ghost