title: Finding the minimum MSSQL compatibility level
body: <p>I know I can use something like this</p>
  
  <pre><code>select compatibility_level from sys.databases where name = 'database'
  </code></pre>
  
  <p>to find out the database compatibility level, but what I'm actually looking for is the minimum that this server supports. Is there a dynamic way of doing this? Or do I have to hard-code the values?</p>
  
  <p><strong>Backgroud:</strong> We have a large number of customers using a wide variety of servers and proving our system against all servers is problematic. If I can set it to a low compatibility level, that I know is well-proven, that's better than setting to high/default. (i.e. it's better - in our scenario - to set a new database on SQL Server 2012 to compatibility 90, than to 100 or 110).</p>