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

Thoughts on programming with an LLM

Where do I begin. The topic is fraught with issues and already decided by thought leaders as a completed achievement. You speak or write out a set of instructions to an LLM and it will implement them by generating the most probabilistic matches with some randomness sprinkled in. Further point
14 Apr 2026 4 min read

Wraps and Lambda methods

I am working in Databricks developing a ContextManager class in python to read and write new metadata for connections, catalogs, tables, etc. As I was doing this I generalized the access pattern that seemed to be happening over and over which was get a value from Databricks. I am using
14 Mar 2026 1 min read

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