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

how to reduce .ldf file

Status
Not open for further replies.

mjp483

Programmer
Apr 27, 2004
42
US
My .ldf file (log file) is too large. I want to know how to reduce it's size nightly after a scheduled db backup. Currently I have a maintenance job that backs up the tran log, but for some reason this doesn't reduce the size of the .ldf file, which I expected. I know how to manually attcah and delete the .ldf file, the reattach, this works great.....but I need to be able to do this nightly, is there a sytax I need to use ...this doesn't work...
BACKUP LOG uspr_reporting WITH TRUNCATE_ONLY.....Is there someone out there that can help me
 
There's lots of information about what you want to do...

Check out the BOL and look at these FAQs:
FAQ183-345
FAQ183-1534

Also, do a search on this forum and FORUM183.

-SQLBill

Posting advice: FAQ481-4875
 
UserDB
select name from sysfiles

USE UserDB
GO
DBCC SHRINKFILE (Name, 7)
GO


Dr.Sql
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top