Click here to Skip to main content
15,886,110 members
Articles / Desktop Programming / MFC
Article

Clear the transaction log

Rate me:
Please Sign up or sign in to vote.
3.20/5 (9 votes)
25 Apr 2002 97.5K   14   1
dump the transaction log

Introduction

How To Clear A SQL Server Transaction Log

[Transaction Log full error]
DUMP TRANSACTION [database_name] WITH NO_LOG

- From the desktop of the machine having the problem, go to Start -> Program Files -> Microsoft SQL Server 6.5


- Launch ISQL_W

- A screen asking you to connect will appear. Fill in the name of the machine you are working on (for example, GEOCSCOLGRA and click Connect. If you have successfully connected a query window will appear.

- Open the drop down menu at the top of the query window. Highlight the name of the database that is having the problem (for example, csco_sideA)

- Type in the following statements. Put each statement on a separate line. Modify the text in bold (for example, change <database name="">to csco_sideA):
dbcc checktable (syslogs)
dump tran <database name="">with no_log
dbcc checktable (syslogs)
dbcc perflog


License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Argentina Argentina
Lic. Fernando Finelli

Comments and Discussions

 
GeneralFor those of you with SQL Server 2000 Pin
Richard Bywater14-May-02 22:17
Richard Bywater14-May-02 22:17 
Microsoft recommends that you use BACKUP instead of DUMP as DUMP is only included for backward compatibility and will not be exist in a future version (although they don't say what version Smile | :) )

BACKUP works the same way really:
BACKUP LOG databasename WITH TRUNCATE_ONLY or
BACKUP LOG databasename WITH NO_LOG

NO_LOG & TRUNCATE_ONLY are synonyms. Personally I prefer TRUNCATE_ONLY 'cos it truncates the log file but its always up to personally preferences I guess Smile | :)

Richard.
(If my advice breaks something OMG | :OMG: , don't blame me Smile | :) )

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.