SELECT object_name(object_id) AS TABLE_NAME,
	rg.state_description,
	count_big(*) as NUM_ROWGROUPS,
	sum(Cast(rg.total_rows AS BIGINT)) as NUM_ROWS,
	AVG(Cast(rg.total_rows AS BIGINT)) as AVG_ROWCOUNT_PER_ROWGROUP,
	MIN(Cast(rg.total_rows AS BIGINT)) as MIN_ROWCOUNT_PER_ROWGROUP,
	MAX(Cast(rg.total_rows AS BIGINT)) as MAX_ROWCOUNT_PER_ROWGROUP,
	SUM(Cast(rg.size_in_bytes AS BIGINT))/1024/1024 as TOTAL_SIZE_MB
FROM sys.column_store_row_groups rg,
	sysobjects t
where t.xtype = 'U'
	and t.id=rg.object_id
group by object_id,
	rg.state_description
ORDER BY TABLE_NAME
GO
