84.6k views
2 votes
How to clear transaction log in sql server

1 Answer

1 vote

Final answer:

To clear the transaction log in SQL Server, use the BACKUP LOG statement with the WITH NO_LOG option.

Step-by-step explanation:

To clear the transaction log in SQL Server, you can use the BACKUP LOG statement followed by the WITH NO_LOG option. This command creates a backup of the transaction log and then truncates it, effectively clearing the log.

Here's an example of how to use the BACKUP LOG statement with the WITH NO_LOG option:

BACKUP LOG <database_name> WITH NO_LOG;

Make sure to replace <database_name> with the name of your specific database.

User Matan Shahar
by
6.8k points