In this SQL Tutorial I will show you how to shrink log file (ldf) to "zero" MB. For the purpose of this tutorial I will use SQL Server 2008 R2.
Usage: As a developer I often work with development environements and is it common task for me to either shrink a log after I perform database restore from live environement or just reduce my current log file. The common problem is that shrink command is not always shrinking the log file and and this tutorial I will cover this particular issue as well:
NOTE: This method is used to permanently remove log data which is useful in development environment but it is not recommended in production environments.
See below an example of a database with log file (ldf) that is slightly over 200MB.
In order to successfuly reduce the size of a log using shrink method we will have to make a change to database recovery model. To reduce log file to almost "zero" MB we need to change recovery model to SIMPLE. If you don't do that you might have an issue of shrink database not shrinking.
To get full access to this page
Become a member or Sign in
Membership is just $3.99/month