SQL Stuff

Get All Compatability Levels Per Database

Here’s some quick SQL Logic to return all the Compatability Modes per Database.

use master;
set nocount on

select
 'server' = serverproperty('servername')
, 'database' = name
, compatibility_level
, 'version' = 
 case compatibility_level
 when 65 then 'SQL 6.5'
 when 70 then 'SQL 7.0'
 when 80 then 'SQL 2000'
 when 90 then 'SQL 2005'
 when 100 then 'SQL 2008/R2'
 when 110 then 'SQL 2012'
 when 120 then 'SQL 2014'
 end
from 
 sys.databases
order by
 name asc
Advertisements

Categories: SQL Stuff

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s