Methods to Know COMPATIBILITY LEVEL of a Database

I want to know Compatibility level please any one can tell what is script for checking compatibility level.

Last updated:9/26/2017 3:39:21 AM

2 Answers

Samuel Fernandes
Samuel Fernandes

Hi Sushant ,

There are many mehods to know compatibility level I will tell one by one

Create database School_Context

Now run any of these codes to know the compatibility levels of the newly created database named School_Context 

1) Use system stored procedure sp_helpdb

EXEC sp_helpdb School_Context

It shows you two results. The first result has the column named compatibility_level

that shows the value. 

2) Use system stored procedure sp_dbcmptlevel

EXEC sp_dbcmptlevel School_Context


 The result is

The current compatibility level is 120. 

3-Use system views

SELECT name,compatibility_level
FROM sys.databases
WHERE name='School_Context'


The result is 120