470,643 Members | 1,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,643 developers. It's quick & easy.

SQL Enterprise Manager and Query Analyzer displaying different Row Counts

The row counts I am getting from SQL Enterprise Manager and Query
Analyzer are different. When I double click a table in Enterprise
Manager it gives me a row count of say 1000. However, when I select *
from that same table in Query Analyzer it returns 1028 rows. Anyone
know why or better yet, how to fix it? Thanks!

Jul 23 '05 #1
2 2156
Ray
EM gets it's number from sysindexes and is only an estimate. For accuracy
you must scan the table. Try select count(*) from table
<jc***@aol.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
The row counts I am getting from SQL Enterprise Manager and Query
Analyzer are different. When I double click a table in Enterprise
Manager it gives me a row count of say 1000. However, when I select *
from that same table in Query Analyzer it returns 1028 rows. Anyone
know why or better yet, how to fix it? Thanks!

Jul 23 '05 #2
(jc***@aol.com) writes:
The row counts I am getting from SQL Enterprise Manager and Query
Analyzer are different. When I double click a table in Enterprise
Manager it gives me a row count of say 1000. However, when I select *
from that same table in Query Analyzer it returns 1028 rows. Anyone
know why or better yet, how to fix it? Thanks!


You could do an DBCC UPDATEUSAGE for the table. That would address the
issue for the moment.

But as Ray says, EM gets the data from sysindexes where it is not an
accurate value. Then again, if there are 100 millions of rows in a table,
that is a lot faster way to get an approxamite number.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.