Howto: Shrink MS SQL Database Transaction Log

As some hosting provider do limited the size of MS SQL database to be hosted, you might found out your database is not really used up the allocated size.

For many cases, it is because your database transaction log used up those spaces and you might not need to have this transaction log for any purpose. To get this resolve, you may shrink the database transaction log.

1. Open the MS SQL Management Studio and connect to the console.
2. Run the following command from SQL Query.

USE <DatabaseName>
DBCC SHRINKFILE(<TransactionLogName>, 1)
DBCC SHRINKFILE(<TransactionLogName>, 1)

** Replace the DatabaseName and TransactionLogName with your database information.

In most of the cases, you may schedule this task to be run automatically if needed.

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.