Table Count not the same in EM as Query Analyzer

  • I have SQL Server 2000 (SP 3). Using EM, I double click on a table and get the record count. Then using QA, I perform a Select * From TableName and get another record count. Why is this?

    Thanks in advance, Kevin

     

  • Select count(*) opens the table and counts all the rows.

    EM uses the information kept in the sysIndexes system table. This information is not kept up to date 100% of the time for performance reasons. You can run sp_updatestats to correct this problem (for the time being).

  • If you have a very dynamic table QA or EM may be grabbing the table info from cache. 

  • In EM, a double click on a table gives a rough estimation of the record count.

    Using SELECT COUNT(*) gives you the correct answer (the same as in QA).

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply