SQL - PowerCram Blog - Page 2

Shrink (truncate) Microsoft SQL transaction log files

Shrink (truncate / purge) MS SQL transaction log files. Use <dbname>Goalter database <dbname> set recovery simplegodbcc shrinkfile (<dbname>_log, 100)gocheckpointgodbcc shrinkfile (<dbname>_log, 100)alter database <dbname> set recovery fullgo Example: Use myDatabaseGoalter database myDatabase set recovery simplegodbcc shrinkfile (myDatabase_log, 100)gocheckpointgodbcc shrinkfile (myDatabase_log, 100)alter database myDatabase set recovery fullgo