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

Data Modeling: SQLite + Python - Part 3

This is a continuation of Sqlite in memory data structures used for general problem solving. As this is a continuation I am going to skip over some of the background details on why to use in memory sqlite and how to create and get to the harder problem that this
06 Aug 2025 6 min read

Data Modeling: SQLite + Python - Part 2

Introduction Working through the question of given text line inputs of a text line with a format of "{City name},{Date},{Max temperature in Celsius}" parse the input lines if possible and find the maximum average temperature for a city in a particular month of a target year.
02 Aug 2025 3 min read

Binary Search

Asked to find the index of a value within a sorted list of numbers. That means binary search right. Point of reference here is that I have never had to do this in a work setting because the data is never ordered or kept in order. Uniqueness sure, but the
20 Jul 2025 1 min read
Empty Space © 2025
Powered by Ghost