How to minimise Transaction Log

Posted on 2005-04-20
Last Modified: 2008-03-03
I have a database which is fed daily from parsed log files. The MSSQL transaction logs from this are huge and I don't actually need them because if there was a database error I would restore from parsing the original log files.

Is there any way I can turn off the transaction logging from within the stored procedures that are called during the parsing so that those stored procedures do not produce transaction logs ? Alternatively is there a way to minimise or shrink or truncate the transaction log before these stored procedures are called so that they will clear down before each run is made ?
Question by:Mamine
    LVL 6

    Accepted Solution

    You can not turn off transaction logging entirely, but you can swich the database into a Simple Recovery Model - that will truncate the transaction log automatically after the transaction is completed.
    LVL 15

    Assisted Solution


    It is also worth assessing Bulk-logged recovery mode for your database:

    In order to remove data from your transaction logs you can run this command:
    More info here:

    To shrink the size of the transaction log file (the number represents the size in MB you wish to shrink to):
    DBCC SHRINKFILE (yourDBName, 50)
    More info here:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now