Row counts

  • Happy new year all,
     
    I hope some one can explain the following and hopefully provide a resolution
     
    From EM double click a table and you get a row count for a table e.g. table_fred = 123000 rows
    From QA run select count (*) from table_fred and the count is 123123
     
    Any ideas?
     
    Stuart

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Now sorted this one - it was a problem with indexes

     

    Stuart

    -------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
    There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
    I would never join a club that would allow me as a member - Groucho Marx

  • Just to make the answer complete here, in case anyone looks for this kind of question. The reason the counts in EM can differ is that it just shows the value that is stored in sysindexes. This value is not updated every time a row is inserted or deleted, but unless the table is very large you can usually trust it to be reasonably close to the real value. But whenever you need the exact count you must do SELECT COUNT(), or first run sp_updatestats.

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

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