February 6, 2007 at 11:29 pm
hello everyone, USING Sql SERVER 2000, sorry FOR my last post AS i post the wrong question, i want TO write queries BY USING Query Analyzer , if it works then will purge data by using queries. ""I want to delete the data from given dates to reduce the size of LDF FILE.""
Kindly tell me how can i do that AS i have no idea how TO do this.
plz reply me WITH SOME good example OR link OR tutorial that briefly AND simply explains this scenerio.
Thanx IN Advance.
February 7, 2007 at 12:38 am
You want to clear out inactive transactions from the log?
If the database is in simple recovery mode, the log will truncate itself automatically after a checkpoint. If you're using full recovery, then either back the log up (backup log to disk...) or truncate the log (not recomended) (Backup log with truncate_only)
Be aware if you are in full recovery mode and tyou truncate the log you are breaking the recovery chain and should do a full database backup as soon as possible.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 8, 2007 at 2:50 am
This is all covered within Books On Line. You'd probably resolve your problem quicker actually using the provided documentation then posting to the forum where it might be a while before anyone responds.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
February 8, 2007 at 9:18 am
You can't do what you are asking. You cannot query the log file (.ldf).
You can truncate the log file, but not by date or anything else. When you truncate the log file, it gets rid of any transaction that has been commited to the database.
I really agree with Colin. You ought to take time to read the Books OnLine (SQL Server documentation).
-SQLBill
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply