Technical Tips and Solutions

Back to Tech Tips

19/07/2006 - Reduce the file size of a SQL Server Database

SQL Server transaction logs can just keep on growing. In order to reduce the file size you need to run the following three commands in Query Analyser:

dbcc shrinkdatabase('dbname')

backup log dbname with truncate_only

dbcc shrinkfile('dbname_Log', 100)

The dbname_Log is generally the name of the log file. If not you will need to replace this with the actual name of the file found in Enterprise Manager.

Back to Tech Tips