title: List MSSQL server compressed tables and when
body: <p>How can I get a list of tables that were compressed and when they were compressed? The query below gives me the list of tables compressed but not sure about when compression was executed (modify_date?)</p>
  <pre><code>SELECT DISTINCT
  SCHEMA_NAME(o.schema_id)  + '.' + OBJECT_NAME(o.object_id) AS TableName,
  p.data_compression_desc AS CompressionType, create_date, modify_date
  FROM sys.partitions  p 
  INNER JOIN sys.objects o 
  ON p.object_id = o.object_id 
  WHERE p.data_compression &gt; 0
  </code></pre>