Multiple choice technology databases

What is process to truncate a transaction log in SQL server

  1. Fire truncate command

  2. Backup the transaction log

  3. Backup the database

  4. Logs cannot be truncated in SQL Server

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In SQL Server, transaction logs are truncated by backing them up (BACKUP LOG). This marks the inactive portion of the log as truncatable and reuses the space. Simply firing a TRUNCATE command doesn't work on transaction logs. The database must be in Full or Bulk-Logged recovery model for log backups to be meaningful. Logs CAN be truncated in SQL Server - this is what backup and maintenance plans do.