Truncating transaction log

  • How to truncate transaction log in Enterprise Manager in SQL Server 2000? -

    In Version 7, there was an option under the Database context menu. But, It is not there in 2000. Also, What are the ways to do this in T-SQL?

  • In T-SQL:

    BACKUP LOG dbname WITH TRUNCATE_ONLY

    Replace dbname with the database name.

    -SQLBill

  • SQLBill is correct.

    Nevertheless, if you do not want to create transaction log backups, which you will need for restores in the future, you can switch your database to "Simple" recovery model.

    The server will truncate the logs automatically in that mode (see BOL for different modes and their limitations).

    best regards,

    chris.

  • Thank you very much for your response!!

    But, Is there any GUI option to truncate transaction log (as in SQL Server 7) without setting the database options such as "Simple Rocovery model" etc,?

  • Thank you very much for your response!!

    But, Is there any GUI option to truncate transaction log (as in SQL Server 7) without setting the database options such as "Simple Rocovery model" etc,?

  • Funny, I just asked that same question to the other DBA's here they told me NO, there is not an EM option to do this.

  • Yes, you can truncate log in EM:

    Right click the database name, select "All Tasks", then "Shrink Database". Click the "Files" button and select the log file name. Select the appropriate radio button "Compress pages ..." or "Truncate free space ...". Finally, schedule it or click OK.

    Bill.

    OCP

    Edited by - billnye101 on 07/29/2003 5:25:28 PM

Viewing 7 posts - 1 through 6 (of 6 total)

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