title: Retrieve SQL Azure service levels for all databases on a server via SQL
body: <p>Prior to upgrading to SQL Azure V12, I was able to get the service level (S1, S2, P1, P2, etc.) of all databases on a SQL Azure database server by running the following query in the master database:</p>
  
  <pre><code>SELECT db.name DatabaseName, ru.sku AS ServiceTier, 
      slo.name AS ServiceLevel, ru.storage_in_megabytes AS StorageInMB, 
      ru.[time] ResourceUsageDateTime
  FROM sys.databases db
  LEFT OUTER JOIN dbo.slo_database_objectives dbslo ON (dbslo.database_id = db.database_id)
  LEFT OUTER JOIN dbo.slo_service_objectives slo ON (slo.objective_id = dbslo.configured_objective_id)
  LEFT OUTER JOIN sys.resource_usage ru ON (ru.database_name = db.name)
  WHERE
      ru.[time] = (SELECT MAX([time]) FROM sys.resource_usage);
  </code></pre>
  
  <p>However, this now returns an error saying:
  "Invalid object name 'dbo.slo_database_objectives'."</p>
  
  <p>Does anyone know of another way to do this via a SQL query?</p>