truncate the log file in simple recovery model in sql server 2005

  • Hi All,

    I have moved a database from one server to another server. After moving the database to new server I had changed the db into simple recovery model & I need to truncate the log file for free disk space in sql server 2005 .

    Please can anybody tell me the query for truncating the log file in simple recovery model in sql server 2005 .

    Thanks ,

  • check out dbcc shrinkfile

    note this is a command you should only run in this sort of circumstance where you are short of disk space, don't run it on a regular basis. Get your tran log to the size it needs to be to support normal operations (including reindexes) and leave it there.

    ---------------------------------------------------------------------

  • sri01.sqldba (5/31/2011)


    I need to truncate the log file for free disk space in sql server 2005 .

    That's not truncating, that's shrinking.

    Truncate = mark space in the log file as reusable, do not change file size

    Shrink = release unused or reusable space in the file to the filesystem

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply