Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
surajpardeshi
Frequent Visitor

SQL Query To find list of tables with 0 Row Counts in MS Fabric Warehouse

I want to find out list of table and schema's present in my Microsoft Fabric Warehouse which have 0 row count or basically which are empty. I have around 9000+ tables. The following queries work fine in our Azure Data Warehouse but don't work in the Fabric Warehouse.

SELECT 
    two_part_name, 
    SUM(row_count) AS row_count
FROM 
    dbo.vTableSizes
GROUP BY 
    two_part_name
ORDER BY 
    row_count DESC;

I tried running the below query as well using UNION ALL, but for 9K tables, it would take a lot of time. Can anyone please suggest the right query for Fabric Warehouse to get the list of tables with 0 Row Counts?

 

SELECT 'AAT.ANA1' AS table_name, COUNT(*) AS row_count FROM [AAT].[ANA1]
UNION ALL
SELECT 'AAT.ANA2' AS table_name, COUNT(*) AS row_count FROM [AAT].[ANA2]
UNION ALL
SELECT 'AAT.ANA3' AS table_name, COUNT(*) AS row_count FROM [AAT].[ANA3]

0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.