In SQL Server, you can use T-SQL to check the compatibility level of a database. All you need to do is query sys.databases
to find the compatibility level for the database in question.
Here’s an example:
SELECT compatibility_level
FROM sys.databases
WHERE name = 'WideWorldImporters';
Result:
compatibility_level ------------------- 130
This example returns the compatibility level of the WideWorldImporters
database.