When the log file is full and the SQL database cannot write to the file, there are two methods available:
The first method: empty the log.
1. Open Query Analyzer, enter command
The following is a reference fragment:
DUMP TRANSACTION database name with NO_LOG
2. Then open Enterprise Manager-right you want to compress the database-all tasks-shrink the database-shrink the file-Select the log file-in the shrink option to shrink to XXM, this gives you a minimum m number that you want to shrink to, just enter the number and make sure.
The second approach has a certain risk, because SQL Server log files are not immediately written to the database master file, such as improper handling, resulting in loss of data.
1: Delete Log
Detach Database Enterprise Manager-> Server-> database-> right key-> Detach database
2: Delete log file
Additional database Enterprise Manager-> Server-> database-> right key-> attached database
This method generates a new log with a size of more than 500 KB.
Note: The first method is recommended.
If you don't want it to get bigger later.
Use under SQL2000:
Right-click on the Database-> properties-> option-> failure recovery-model-select-Simple model.
or with SQL statements:
The following is a reference fragment:
ALTER DATABASE name set recovery simple
In addition, Truncate log on checkpoint (this option is used in Sql7.0,sql 2000, the recovery model is selected as a simple model) when the checkpoint command is executed if the transaction log file exceeds its size of 70% Then clear its contents often set this option to true auto shrink periodically check the database when the unused space of the database file or log file exceeds 25% of its size, the system automatically shrinks the file so that its unused space equals 25% When the file size does not exceed its initial size when it is established, the file reduction file must also be greater than or equal to its initial size the reduction of the transaction log file can only be done if it is backed up or when the Truncate log on Checkpoint option is set to true.
Note: Generally established database default properties have been set, but encountered unexpected circumstances so that the database properties have been changed, please empty the log, check the database above properties, in case the transaction log again full.