Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: Shrinking Transaction Log

    Hi All,

    I have steps that I take to shrink transaction log. One of the steps is to delete the transaction log after I detach the database. Am I losing any data by doing that?

  2. #2
    Join Date
    Dec 2002
    Posts
    1,245
    Quote Originally Posted by inka
    Hi All,

    I have steps that I take to shrink transaction log. One of the steps is to delete the transaction log after I detach the database. Am I losing any data by doing that?
    Yikes!! Double yikes!!

    You are not necessarily risking data doing this. When you detach the database from the server, SQL should "clean up" transactions and any uncommitted data will be thrown away. However, this is certainly NOT in the realm of best practices. For one thing, you are taking your database off line to do this which means your customers or your business are not getting answers. Also, you run the risk of deleting the wrong file or having something else catastrophic happen.

    Crack open SQL Books on Line. Have a look at the Recovery Model. Open up a Maintenance wizard and step through the process of making a full backup and then a transaction log backup.

    When scheduled regularly, a transaction log backup should prevent the log file from growing too large and should enable you to recover your database to any given point in time (a great thing for when that 'special' user does something really unexpected).

    Regards,

    hmscott
    Have you hugged your backup today?

  3. #3
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Where exactly did you get that step?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •