Two methods are available when the log file is full and the SQL database cannot write to the file:
One way: Empty the log.
1. Open Query Analyzer, enter a command
DUMP TRANSACTION database name with NO_LOG
2. Open Enterprise Manager again--right click on the database you want to compress--all tasks--shrink the database--Shrink the file--Select the log file--in the contraction mode to choose to shrink to XXM, here will give an allowable contraction to the minimum number of M, directly enter this number, OK.
The other approach has some risk, because SQL Server log files are not written to the database master file immediately, such as improper processing, can cause data loss.
1: Delete Log
Detach Database Enterprise Manager-> Server-> Database-> Right-click-> Detach Database
2: Delete log file
Attach Database Enterprise Manager-> Server-> Database-> Right-click-> Attach Database
This method generates a new log with a size of more than 500 K.
Note: The first method is recommended.
If later, do not want it to become larger.
Use under SQL2000:
On the database, right-click Properties--Options--model-selection-simple model.
or with an SQL statement:
ALTER DATABASE name set recovery simple
In addition, Truncate log on checkpoint (this option is used for Sql7.0,sql 2000, i.e. the recovery model is selected as a simple model) when the checkpoint command is executed if the transaction log file exceeds 70% of its size Clear the content in the development database always set this option to true auto shrink periodically checks the database when the unused space of the database file or log file exceeds 25% of its size, the system will automatically shrink the file so that its unused space equals 25% Files that do not shrink when the file size is not larger than the initial size when it is established must also be greater than or equal to the initial size of the transaction log file to be reduced only if it is backed up or the Truncate Log on Checkpoint option is set to true.
Note: The default properties of the database that are generally established are set, but when unexpected conditions make the database properties changed, after the user empties the log, check the properties of the database to prevent the transaction log from being filled again.