SQL Server‎ > ‎

How to manually shrink a sql log file

Execute this sql command:

DBCC SHRINKFILE(Database_log, 1)

The 1 is the file id you can find by running this against your current database:

select * from database.sys.database_files

If it doesn't work, it could be that your recovery model for the database is set to "full".   If you temporarily set it to "simple" the shrinkfile process will work.




Comments