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

Strong Opinions, weakly held

Translation 💡Irrational confidence and glaze your opponents I want to dig into this trite phrase that isn't insightful unless your insight is manipulation delivered with a smile. This phrase popularized by large software companies management idiots i.e. Amazon, Microsoft, Google is not of value and is in
20 Jun 2026 2 min read

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