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 |
|
kiruthika
Yak Posting Veteran
67 Posts |
Posted - 2007-11-18 : 23:31:56
|
| HI! 1.select count(*) from sales 2.select rows from sysindexes where id=object_id('sales') and indid<2both queries return number of rows.can anyone tell me which one is better? |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-11-19 : 01:47:09
|
| Method 1 is always reliableIn order to get accurate count you need to run DBCC Updateusage('dbname','tablename') with count_rows before running method 2MadhivananFailing to plan is Planning to fail |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-11-19 : 11:59:51
|
| Better How?Method one as Madhivanan said is accurate. Where as Method two is less resource intensive, but may not be 100% accurate. |
 |
|
|
|
|
|