dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Test-DbaDatabaseCompatibility

Compares Database Compatibility level to Server Compatibility

Screenshots

test-dbadatabasecompatibility

Examples

To return server name, database name and true/false if the compatibility level match for all databases on sqlserver2014a

Test-DbaDatabaseCompatibility -SqlServer sqlserver2014a

To return server name, database name and true/false if the compatibility level match for the db1 and db2 databases on sqlserver2014a

Test-DbaDatabaseCompatibility -SqlServer sqlserver2014a -Databases db1, db2

To return lots of detailed information for database and server compatibility level for all databases except db1 on sqlserver2014a and sql2016

Test-DbaDatabaseCompatibility -SqlServer sqlserver2014a, sql2016 -Detailed -Exclude db1

To return db/server collation information for every database on every server listed in the Central Management Server on sql2016

Get-SqlRegisteredServerName -SqlServer sql2014 | Test-DbaDatabaseCompatibility

Get-Help

From PowerShell, execute Get-Help Test-DbaDatabaseCompatibility -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaDatabaseCompatibility.ps1 on GitHub
 

Related commands