|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Table row counts differentCan someone exlpain why you get different row counts in different places?
For example, when I double-click on a table in EM to display the properties of the table and look at the Rows number, that is different than when I query like select count(*) from table. Andre,
I don't get any differences. Are you sure the table hasn't been modified in between the 2 queries? Barry SELECT COUNT(*) gets an actual, real-time count.
sp_spaceused and EM use a relatively "stale" count from sysindexes, which is only updated periodically. To make these more current, issue DBCC UPDATEUSAGE(0) which will update sysindexes and EM for all tables in the database. Or just use SELECT COUNT(*)... (EM is not a reliable place for very many things). Show quote "Andre" <An***@discussions.microsoft.com> wrote in message news:C7157969-A5C7-414A-8779-4E1CF26A5BDB@microsoft.com... > Can someone exlpain why you get different row counts in different places? > For example, when I double-click on a table in EM to display the > properties > of the table and look at the Rows number, that is different than when I > query > like select count(*) from table. EM picks up the row count from sysindexes, which is a very quick way to do it. But the value in
sysindexes might not be accurate (by design). See DBCC UPDATEUSAGE for more information. -- Show quoteTibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog: http://solidqualitylearning.com/blogs/tibor/ "Andre" <An***@discussions.microsoft.com> wrote in message news:C7157969-A5C7-414A-8779-4E1CF26A5BDB@microsoft.com... > Can someone exlpain why you get different row counts in different places? > For example, when I double-click on a table in EM to display the properties > of the table and look at the Rows number, that is different than when I query > like select count(*) from table. |
|||||||||||||||||||||||