Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pradeep_iete
Yak Posting Veteran
84 Posts |
Posted - 2010-01-15 : 07:14:10
|
Hi All, Guys Can u all tell me when difference between following queries exist then how to update it in system.cataloguesQuery1) SELECT count(*) FROM <table>Query2) SELECT rowcnt FROM sys.indexes WHERE Object_ID=OBJECT_ID(<TABLE>)ORSELECT * FROM sys.partitions WHERE Object_ID=OBJECT_ID(<TABLE>)I have found difference between the two queries all the time ?WHY it is SO?How we can update the deficit therefore ? |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2010-01-15 : 08:07:57
|
count * counts every record (subject to the where clause)count somecol only counts records with somecol notnull (ditto) |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2010-01-15 : 10:15:13
|
DBCC UpdateUsageShouldn't be needed on SQL 2005, but if this DB was upgraded from SQL 2000, there could still be discrepancies.--Gail ShawSQL Server MVP |
|
|
|
|
|