<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using sys.partitions to find rows of tables in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634324#M2829</link>
    <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="913195" data-lia-user-login="nilendraFabric" class="lia-mention lia-mention-user"&gt;nilendraFabric&lt;/a&gt;&amp;nbsp;- interesting link as well, I didn't know the&amp;nbsp;&lt;EM&gt;rows&lt;/EM&gt; column only gave an approximate row count, for instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand you correctly, the intention behind the &lt;EM&gt;rows&lt;/EM&gt; column is to show the number of rows, but is &lt;EM&gt;currently&lt;/EM&gt; limited to only do so for system tables. Do you have any idea whether this limitation will be removed at some point in the future, so that we can also use it for user tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mikkel&lt;/P&gt;</description>
    <pubDate>Wed, 02 Apr 2025 05:45:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2025-04-02T05:45:01Z</dc:date>
    <item>
      <title>Using sys.partitions to find rows of tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4633312#M2820</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I'm trying to use sys.partitions to get the number of rows for all tables, such as described &lt;A href="https://learn.microsoft.com/en-us/answers/questions/1726506/i-need-a-row-count-for-every-table-in-a-specified" target="_self"&gt;here&lt;/A&gt;. I'm in Fabric, and using the SQL Analytics Endpoint for a Lakehouse, and just a SQL query in Warehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, for all tables&amp;nbsp;&lt;EM&gt;except&lt;/EM&gt; system tables (e.g., sysowners), the partition_number column equals 1, but rows is zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this a limitation with Lakehouse/Warehouse, am I misunderstanding the purpose of sys.partitions, or is there something wrong going on?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is one of the queries I've tried:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;select t.name, p.partition_number, p.rows, o.name 
from sys.partitions as p
left join sys.tables as t
    on t.object_id = p.object_id 
left join sys.objects as o
    on p.object_id = o.object_id &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 12:56:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4633312#M2820</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-01T12:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using sys.partitions to find rows of tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4633528#M2825</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using&amp;nbsp;&lt;/SPAN&gt;sys.partitions&lt;SPAN&gt;&amp;nbsp;to get row counts in Microsoft Fabric has limitations that you're encountering. In Fabric (both Lakehouse SQL Analytics Endpoints and Warehouses), the&amp;nbsp;&lt;/SPAN&gt;rows&lt;SPAN&gt;&amp;nbsp;column in&amp;nbsp;&lt;/SPAN&gt;sys.partitions&lt;SPAN&gt;&amp;nbsp;typically returns 0 for user tables, despite the partition_number showing as 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://sqlkover.com/get-row-counts-of-all-tables-in-a-microsoft-fabric-warehouse/" target="_blank" rel="noopener"&gt;https://sqlkover.com/get-row-counts-of-all-tables-in-a-microsoft-fabric-warehouse/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The most reliable method to get row counts at the moment is to use&amp;nbsp;SELECT COUNT(1)&amp;nbsp;on each table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 14:23:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4633528#M2825</guid>
      <dc:creator>nilendraFabric</dc:creator>
      <dc:date>2025-04-01T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Using sys.partitions to find rows of tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634324#M2829</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="913195" data-lia-user-login="nilendraFabric" class="lia-mention lia-mention-user"&gt;nilendraFabric&lt;/a&gt;&amp;nbsp;- interesting link as well, I didn't know the&amp;nbsp;&lt;EM&gt;rows&lt;/EM&gt; column only gave an approximate row count, for instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand you correctly, the intention behind the &lt;EM&gt;rows&lt;/EM&gt; column is to show the number of rows, but is &lt;EM&gt;currently&lt;/EM&gt; limited to only do so for system tables. Do you have any idea whether this limitation will be removed at some point in the future, so that we can also use it for user tables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mikkel&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 05:45:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634324#M2829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-02T05:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using sys.partitions to find rows of tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634456#M2830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thank you for engaging with the Microsoft Fabric community, &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="913195" data-lia-user-login="nilendraFabric" class="lia-mention lia-mention-user"&gt;nilendraFabric&lt;/a&gt;&amp;nbsp;,Your response is much appreciated.&lt;/P&gt;
&lt;P&gt;In Microsoft Fabric, the rows column in sys.partitions doesn't display row counts for user tables, typically returning 0, while partition_number is 1. This is a known limitation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To obtain row counts, the most reliable method is to use SELECT COUNT(1) for each table.&lt;/P&gt;
&lt;P&gt;Microsoft has not provided any updates on whether this limitation will be resolved.&amp;nbsp; To help prioritize this, you can submit feedback or vote for related ideas in the Microsoft Fabric Ideas Forum.&lt;BR /&gt;&lt;A href="https://community.fabric.microsoft.com/t5/Fabric-Ideas/idb-p/fbc_ideas" target="_blank"&gt;Fabric Ideas - Microsoft Fabric Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If my response resolved your query, kindly mark it as the&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Accepted Solution&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;to assist others. Additionally, I would be grateful for a&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;'Kudos'&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;if you found my response helpful.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 07:20:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634456#M2830</guid>
      <dc:creator>V-yubandi-msft</dc:creator>
      <dc:date>2025-04-02T07:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using sys.partitions to find rows of tables</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634464#M2831</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="883001" data-lia-user-login="V-yubandi-msft" class="lia-mention lia-mention-user"&gt;V-yubandi-msft&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 07:24:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/Using-sys-partitions-to-find-rows-of-tables/m-p/4634464#M2831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-02T07:24:50Z</dc:date>
    </item>
  </channel>
</rss>

