Row Count for a table


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Row Count for a table

  1. #1
    Michael Giordano Guest

    Row Count for a table


    I remember seeing a query that returns the row count for a table using system
    tables (i.e. NOT using COUNT(*)).

    I have searched Books online, MSDN and a bunch of sites and cant find it.

    Can someone please post that query please?

  2. #2
    Gundapaneni Guest

    Re: Row Count for a table


    Hi,

    You will get, what you have asked in your question by using SYSINDEXES system
    table, by writing following query\\\\

    SELECT id,rowcnt FROM sysindexes

    Here id=object id...U can obtain object name by using OBJECT_NAME(id) function.
    rowcnt= Row count for that object.


    Madhu.G










    "Michael Giordano" <cissmjg@hotmail.com> wrote:
    >
    >I remember seeing a query that returns the row count for a table using system
    >tables (i.e. NOT using COUNT(*)).
    >
    >I have searched Books online, MSDN and a bunch of sites and cant find it.
    >
    >Can someone please post that query please?



  3. #3
    veemal Guest

    Re: Row Count for a table


    You can use sp_spaceused tablename

    or do a query on sysindexes table.




    "Michael Giordano" <cissmjg@hotmail.com> wrote:
    >
    >I remember seeing a query that returns the row count for a table using system
    >tables (i.e. NOT using COUNT(*)).
    >
    >I have searched Books online, MSDN and a bunch of sites and cant find it.
    >
    >Can someone please post that query please?



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center