Software >> Services >> RDBMS >> SQL Server >> How to shrink database transaction log and prevent uncontrolled growth

Following example is for a database named CMS on SQL Server 2000 1. Backup the transaction log. 2. Launch the "Query Analyzer" and select the database for the affected transaction log (for this example CMS). 3. At the "Query Analyzer", type the following: a. USE CMS BACKUP LOG CMS WITH TRUNCATE_ONLY DBCC SHRINKFILE (CMS_Log, 500) b. Execute the above commands. 4. The SQL command "USE CMS" above is to tell the "Query Analyzer" to use the CMS database. This is just a precautionary measure that you forgot to select the database in the "Query Analyzer". 5. From enterprise manager, select the database, right click, properties -> Options set recovery model = simple, and tick the "Auto shrink" option.