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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need to truncate log file?

Status
Not open for further replies.

nowayout

Programmer
Feb 25, 2003
364
US
Hi there,

I need to truncate or shrink the log file because they are almost the size of the database file how cani do that and prevent for future please?

Thanks
 
How Do I Develop a Backup and Restore Strategy? faq183-1784
Shrinking Databases and Logs - SQL 7 and Higher faq183-1534
Why won't my transaction log shrink? faq183-345
 
BACKUP LOG DbName WITH TRUNCATE_ONLY
GO
USE DbName
DBCC SHRINKFILE(DbName_log, size want to shrink it to). There are numerous examples on BOL in case you are still confused.

This should help you out. If you want you may set it up as a job on whichever database the log file seems to grow disproportionately large for.

Maria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top