How do you check collation and compatibility level for a database?


Scenario

There is a common practice in the DBA world to work on a daily basis with back-ups and restoring of databases on different servers with different configurations. In an ideal world you would have the same collation and the same compatibility level on all your machines but for cases when this doesn’t happen here’s how to get the information you need. 

Solution

The following query can be used to see the collation and compatibility level your databases:

SELECT compatibility_level,

collation_name

FROM sys.databases

WHERE name =’YOUR DATABASE NAME HERE’

 

Thanks for reading this article,

Next steps :

  1. Add this script to your database toolkit
  2. Share this with your colleagues because Sharing is Learning
  3. Comment below if you need any assistance