ADS

Featured

How to disable logging on SQL Server

This week I had some problems with the database transaction log, which when running a query presented the following error:

The transaction log for database 'x' is full. To find out why space in the log cannot be reused, [...] 

In other words, the database transaction log was full, but the bank was a mere 50 Mb in size, that is, I wanted to disable this log since I do not use it.

The log is used to show which codes were executed in the bank, and there are two types of logs (and it is not possible to disable):

Simple (Simple) and Complete (Full).

Full stores all the bank's actions in a log, and the simple discards all changes in the bank as soon as a checkpoint is performed, or better, every script interaction in the database.

To change between the two, use the command:

ALTER DATABASE x SET RECOVERY SIMPLE;

or to return to using the full transaction log, follow the command:

ALTER DATABASE x SET RECOVERY FULL;

"X" being your database containing the tables.

Tip: Depending on the version of your database, the command needs to be capitalized (all capitals).

Here is an example of an error when the transaction table is "full", not allowing any operation with the database:



No comments