October 3, 2017

Different Methods to Know COMPATIBILITY LEVEL of a Database

There are many methods to know the compatibility levels of a database.

1) Use system stored procedure sp_helpdb
   
EXEC sp_helpdb TEST



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 TEST

The result is

The current compatibility level is 120.

3) Use system views
   
SELECT name,compatibility_level
FROM sys.databases
WHERE name='TEST'


The result is


name    compatibility_level
master    110
tempdb    110

No comments:

Post a Comment