SQL Server - Transaction Log Full

Posted on 2012-08-13
Last Modified: 2012-08-13
I'm trying to delete all record in a table.. but I get transaction log full.
I've tried this.. but same result.. How can delete the log and delete all my records.
what's wrong


Question by:JElster
    LVL 16

    Accepted Solution

    If you use the following it should work.


    Open in new window

    Although this should only be used if you want to remove all data from a table.
    LVL 13

    Expert Comment

    Usually the Transaction logs are flushed after a backup.  The above from Evil will flush the logs but you'll lose any pending transactions that haven't been committed.  Run a backup of the database and then the logs should shrink.
    LVL 16

    Expert Comment

    No, what I posted above does not flush the logs. It flushes the table by resetting the high watermark of the table. The reason i am suggesting this is because it is a non-logged operation and will therefore no fill the transaction log up.

    Also you will not loose any pending transactions as you would have to kill the SQL Server process and delete the transaction log to do that.

    Truncating the transaction is a way to clear down the transaction log, which was supported previously by running BACKUP LOG [MyDatabase] WITH TRUNCATE_ONLY

    These days, you should change the recovery model to simple and back again.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
    There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 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

    20 Experts available now in Live!

    Get 1:1 Help Now