-
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?
-
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?
-
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
Forum Rules
|
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
|
Bookmarks