Get List of Empty Tables in SQL Server

  1. select  
  2. t.name table_name,  
  3. s.name schema_name,  
  4. sum(p.rows) total_rows  
  5. from  
  6. sys.tables t  
  7. join sys.schemas s on (t.schema_id = s.schema_id)  
  8. join sys.partitions p on (t.object_id = p.object_id)  
  9. where p.index_id in (0,1)  
  10. group by t.name,s.name  
  11. having sum(p.rows) = 0;