The log file is not shrinking with SQL Shrink

55 Views Asked by At

I'm trying to perform a shrink operation on SQL Server Management Studio (SSMS), but the log file is not shrinking. Is there a specific code that can be used in this situation? Can you help me with the code for this?

I attempted to shrink the LOG file but was unable to do so.

1

There are 1 best solutions below

0
Ehsan R On

When you shrink Database, Only the mdf File Shrinks. and the ldf File (Which is LOG file) will have no changes.

If you want to reduce the size of ldf File, right click on Database, on properties>Files set the Size(Mb) of your LOG file. after setting that(if db recovery is simple) it reduces. Also you can Limit Max size of LOG file in properties>Files Autogrouth/MaxSize settings.