Sql-server – How to tell which versions support a given DMV column

sql server

Each version of SQL Server potentially adds new columns to the DMVs. These new columns are available even if you change the compatibility level of the database to a previous version.

Is there a list somewhere that shows which columns are available for a given version of SQL Server?

Best Answer

Each version of SQL Server potentially adds new columns to the DMVs.

Correct, and since each CU is technically a new version this can happen inside of major version releases.

Is there a list somewhere that shows which columns are available for a given version of SQL Server?

While this may not be in the spirit of the question asked, there technically is an answer which is to use the system tables. For example, what columns does sys.availability_groups currently have in this version (14.0.3037):

select name FROM sys.all_columns where object_id = object_id('sys.availability_groups') order by column_id asc

Will output:

╔═════════════════════════════════════════════╗
║                    name                     ║
╠═════════════════════════════════════════════╣
║ group_id                                    ║
║ name                                        ║
║ resource_id                                 ║
║ resource_group_id                           ║
║ failure_condition_level                     ║
║ health_check_timeout                        ║
║ automated_backup_preference                 ║
║ automated_backup_preference_desc            ║
║ version                                     ║
║ basic_features                              ║
║ dtc_support                                 ║
║ db_failover                                 ║
║ is_distributed                              ║
║ cluster_type                                ║
║ cluster_type_desc                           ║
║ required_synchronized_secondaries_to_commit ║
║ sequence_number                             ║
╚═════════════════════════════════════════════╝

More in the spirit of the question, Docs is your best source for columns based on version outside of your own queries.