Author |
Topic |
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2012-09-09 : 03:18:40
|
I have a table where the actual count is only 77631. However when I execute a simple select statement for that table, it reaches millions and counting. It seems so strange. Have anyone encountered same issue before?Any help is highly appreciated. thanks in advance.For fast result follow this...http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxWant Philippines to become 1st World COuntry? Go for World War 3... |
|
chadmat
The Chadinator
1974 Posts |
Posted - 2012-09-09 : 04:15:02
|
Show us the select-Chad |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2012-09-09 : 04:22:57
|
Its only "select * from slip_sales". Only one table. From Getting row count of table in SQL Server 2005 (http://dimantdatabasesolutions.blogspot.com/2008/05/getting-row-count-of-table-in-sql.html), the actual count of that table is 70K+ only. However, when I use the select statement it reaches 12M+. I restore the database on my laptop just to make sure that there are no other running applications.For fast result follow this...http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxWant Philippines to become 1st World COuntry? Go for World War 3... |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2012-09-09 : 04:29:42
|
Do:SELECT Count(*) FROM Slip_Sales-Chad |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
Posted - 2012-09-09 : 04:35:49
|
tnx for the reply chad. I already tried that one. However, I could not get the count using that statement. I took a lunch and when I come back after an hour, I still don't have the count. hmmm, Maybe the table is corrupted?For fast result follow this...http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxWant Philippines to become 1st World COuntry? Go for World War 3... |
|
|
chadmat
The Chadinator
1974 Posts |
Posted - 2012-09-09 : 04:36:48
|
Run a DBCC Checktable (Or DBCC Checkdb)-Chad |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
|
chadmat
The Chadinator
1974 Posts |
Posted - 2012-09-09 : 04:38:14
|
Corruption is the only thing that makes any sense.-Chad |
|
|
jonasalbert20
Constraint Violating Yak Guru
300 Posts |
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2012-09-10 : 10:02:32
|
Total number of rows can be extracted using following query.SELECT OBJECT_NAME(OBJECT_ID), sys.partitions.rowsFROM sys.partitionsWHERE index_id = 1 AND object_id = OBJECT_ID('Slip_Sales')--------------------------http://connectsql.blogspot.com/ |
|
|
|