FIX: DMVs "sys.dm_db_log_stats" and "sys.dm_db_log_info" return incorrect values for the last database in SQL Server 2016 and 2017

Applies to: SQL Server 2016 DeveloperSQL Server 2016 EnterpriseSQL Server 2016 Enterprise Core

Symptoms


In Dynamic Management Views (DMV) in an instance of Microsoft SQL Server 2016 or 2017, you experience the following behavior:

  • When you select from the sys.dm_db_log_stats view by passing a "NULL" parameter, no results are returned.
  • When you select from the sys.dm_db_log_info view by passing a "NULL" parameter, the last database of the instance does not appear in the results.

Resolution


This problem is fixed in the following cumulative updates for SQL Server:

       Cumulative Update 9 for SQL Server 2017

       Cumulative Update 2 for SQL Server 2016 SP2

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


Learn about the terminology that Microsoft uses to describe software updates.