☰ Categories

MSSQL: Shrink a DB transation log

MSSQL shrink a DB transation log
Start the SQL Query tool
Tool – SQL Query Analyzer

1. Type: BACKUP LOG <database name> WITH TRUNCATE_ONLY
2. Execute the command with the play button >

The database will is now flush, but it still need to have the size reduce
3. Shrink the database: Right Click the Database – All Tasks – Shrink Database
4 Click OK

The Shrink Command line is: DBCC SHRINKFILE(DatabaseName_log,2