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?
Printable View
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?
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?
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?