Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you TRUNCATE the ttansaction log?

Status
Not open for further replies.

christheprogrammer

Programmer
Jul 10, 2000
258
CA
Hi,
I just need to manually TRUNCATE the transaction log. I am writing code in a test DB so the repercussions don't matter. All I know is the format TransactionLogObject.Truncate()
Can anyone tell me where the TransactionLogObject is located and what code do you write to truncate?

TIA
Chris Chris
grandin1@yahoo.com
 
if you just need a quick and dirty solution use:
dump transaction <database_name> with no_log
if you want to truncate your trans log on a routine basis, you can set the database options in SQL 7 to 'truncate log on checkpoint' or in SQL 2000 'recovery mode: simple'
 
Muchos Gracias Senor, it appeared to work although I don't know how to view the transaction log or its size. Chris
grandin1@yahoo.com
 
hey! its senorita :)
as far as i know, you cannot 'view' the contents of the transaction log; however, you can view its physical location by right clicking on the database in enterprise manager and selecting 'properties'. click on the 'transaction log' tab - this will show you the file location and size. the only way that i know to 'view' a transaction log is to use a third party tool like lumigent's log explorer:
 
Thanks! Sorry about assuming you were a guy... I have solved the problem now, I had filled up the reletively small C drive on the server which is where the tempDb resided by default. It is now split between C and another large drive. The error message mentioned the transaction log because it was during an update query when the c drive maxed out.
Thanks Alot for your input!
Have a great day

Chris Chris
grandin1@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top