Sep
09
2005

Truncating SQL Server 2000 Log Files

I run several SQL Server 2000 databases that have lots of updates to them every day. Inevitably our log files grow very large. I discovered a long time ago that you could shrink them by backing them up.

All that was left was to make it back up every day so that it never grew too big to backup. Unfortunately, I let it grow to big and I was no longer able to back it up because it was now 11 gb!

Finally, after much searching, I found this tool that shrinks your log file for you using the SQL-DMO object.

Here you go: http://www.codeproject.com/database/ShrinkingSQLServerTransLo.asp

Share and Enjoy:
  • del.icio.us
  • digg
  • Furl
  • NewsVine
  • RawSugar
  • Reddit
  • Spurl
  • YahooMyWeb
Written by Tom in: SQL Server |

1 Comment »

  • Tom

    For 2005, all you need is a SQL script:

    USE BWD
    GO
    DBCC SHRINKFILE(bwd_log, 1)
    BACKUP LOG BWD WITH TRUNCATE_ONLY
    DBCC SHRINKFILE(bwd_log, 1)

    –Optional:
    –BACKUP LOG BWD TO DISK=’D:\BWD.bak’

    (BWD is the name of the database)

    Comment | April 26, 2008

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes