DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  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?



Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links