470,596 Members | 1,117 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Mismatch between Count(*) and Properties -> Rows

I have a client who has reported a discrepancy in their database. In
their test database a certain report returns 5,333 rows, but in the
production database it returns 5, 332 rows.

I'll get to the bottom of it in due course, but I came across an
oddity. I wanted to know how many rows there were in a particular
table on both databases so I wrote:

SELECT COUNT(*) AS NumRows FROM Answer

It returned 1,919,456. However, if I click on the Answer table in
Enterprise Manager and select Properties it tells me that there are
1,919,421 rows. I've tried doing a refresh but it didn't work.

The thing is that the database is pretty static - in fact there's been
no activity (apart from me examining it) for a couple of days.

Thoughts?

Edward

Jun 29 '07 #1
1 1539
On Fri, 29 Jun 2007 07:28:03 -0700, te********@hotmail.com wrote:
>SELECT COUNT(*) AS NumRows FROM Answer

It returned 1,919,456. However, if I click on the Answer table in
Enterprise Manager and select Properties it tells me that there are
1,919,421 rows. I've tried doing a refresh but it didn't work.
Those statistics are not always accurate. To fix them run

DBCC UPDATEUSAGE(0) WITH COUNT_ROWS

Roy Harvey
Beacon Falls, CT
Jun 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sunil Korah | last post: by
3 posts views Thread by amitbadgi | last post: by
2 posts views Thread by Clark Sann | last post: by
6 posts views Thread by Howard Kaikow | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.