Re: Wrong number of rows

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 18:38:15 +0100

This information most probably comes from the sysindexes table (see the documentation) and the
information in sysindexes isn't guaranteed to be up-to-date. This is a known fact in SQL Server. To
get 100% accurate row count, do SELECT(*).

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"Vik" <viktorum@==hotmail.com==> wrote in message news:OCHuMl7BFHA.3376@TK2MSFTNGP12.phx.gbl...
> In a table properties window, a number of rows is 2 rows more than the actual number of rows in 
> the table, returned by COUNT(*) and counted manually. How could this happen? Is the table 
> corrupted?
>
> Thank you.
>
>
>
> 


Relevant Pages

  • Re: Orphan Indexes?
    ... Consider yourself lucky that you didn't work out how to delete the rows from sysindexes. ... "If it bleeds, we can fix it". ... is a bug in SQL Server, MS can probably rather quickly find a fix if you open a case... ... I have tried changing the owner of the table and then performing ...
    (microsoft.public.sqlserver.programming)
  • Re: Records in a database
    ... you can get an estimated rowcount from ... sysindexes using the query below. ... in case you wish to write your own query. ... >> Wayne Snyder, MCDBA, SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: Index Creation Date
    ... Mistake, mistake.. ... >>Join sysindexes and sysobjects and use the crdate in the ... Read details on SQL Server Books Online. ...
    (microsoft.public.sqlserver.security)
  • Re: Counting rows in an SQL table
    ... indid <= 1 ... You may have to execute DBCC UPDATEUSAGE to get the value to ... You'd get a better response if you posted this question in a SQL Server ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Documenting Tables and Queries
    ... SQL Server does not provide a stored procedure ... If you want the code of a stored procedure, you could get the script from ... SELECT name FROM sysindexes WHERE indid in( ...
    (microsoft.public.sqlserver.tools)