How to Compress .ldf File ?
I have writen a program that are take database name and reduce the size of .ldf file
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tejas TrivediRank #1,247 · 1.4K reputationPosted Nov 9, 2016, 7:53 PM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Nov 10, 2016, 12:05 AM EST
I think you can use DBCC SHRINKFILE to compress log files..
https://msdn.microsoft.com/en-us/library/ms189493.aspx
krishna kanhaiya191 reputationPosted Nov 10, 2016, 12:23 AM EST
krishna kanhaiya191 reputationPosted Nov 10, 2016, 1:15 AM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Nov 10, 2016, 4:20 AM EST
krishna kanhaiya191 reputationPosted Nov 10, 2016, 6:40 PM EST
ali tuncerRank #1,499 · 1.1K reputationPosted Nov 11, 2016, 12:26 AM EST
if you want to shrink a log file, I don' think you need to alter database, get your fileId from this query :
FROM sys.database_files;