Developing Microsoft SQL Server Databases — Question 37

You have a SQL Server 2012 database named DB1. You have a backup device named Device1.
You discover that the log file for the database is full.
You need to ensure that DB1 can complete transactions. The solution must not affect the chain of log sequence numbers (LSNs).
Which code segment should you execute?

Answer options

Correct answer: D

Explanation

The correct answer is D because backing up the log allows SQL Server to clear the inactive portion of the transaction log, enabling transactions to continue without affecting the LSN chain. Option A is incorrect as COPY_ONLY does not affect the backup chain, but it is not necessary for this scenario. Option B's NORECOVERY mode is used for restoring a database and will not allow transactions to continue. Option C is outdated and not supported in newer SQL Server versions.