SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Enterprise Manager Table properties vs count(*)..
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

reenz
Starting Member

29 Posts

Posted - 04/04/2006 :  22:12:02  Show Profile
When i double click on my table in enterprise manager, it shows 35367 rows. But when i do a count(*), it returns 35527! I did a commit to confirm that there's no uncommitted transaction but it's still the same.. anyone knows what should be the correct number of rows in the table? and what can i do to solve this inconsistency error?

nosepicker
Constraint Violating Yak Guru

USA
366 Posts

Posted - 04/05/2006 :  00:44:12  Show Profile
EM uses the data from sysindexes system table to get its rowcount. But if you query sysindexes before the table's statistics are updated, you will get this inconsistency. Update statistics to better ensure consistency in this regard. Using SELECT COUNT(*) will always be more accurate (but will be slower).
Go to Top of Page

Kristen
Test

United Kingdom
22403 Posts

Posted - 04/05/2006 :  00:46:35  Show Profile
Try doing a

DBCC UPDATEUSAGE (0)

and then repeating the test.

Kristen
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 04/05/2006 :  01:25:41  Show Profile  Send madhivanan a Yahoo! Message
It is always better to use Query Analyser than EM

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

reenz
Starting Member

29 Posts

Posted - 04/05/2006 :  01:41:20  Show Profile
Hmmmmm

sysindexes shows my table with 35367 instead of 35527...

I did a DBCC UPDATEUSAGE (0) and it's still showing the same results

o_O""

Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22713 Posts

Posted - 04/05/2006 :  01:50:35  Show Profile  Send madhivanan a Yahoo! Message
If you want to know exact count, then use select count(*) from table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000