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 |
|
js.reddy
Yak Posting Veteran
80 Posts |
Posted - 2008-05-06 : 05:37:33
|
| How can know I how may records are there in a table with out using count(*)RegardsReddy |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-06 : 05:44:16
|
| [code]select sum(1) from table[/code]OR[code]SELECT rows FROM sysindexes WHERE id = OBJECT_ID('Sometable') AND indid < 2[/code]Note: Second alternative may not give accurate results.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
js.reddy
Yak Posting Veteran
80 Posts |
Posted - 2008-05-06 : 05:45:56
|
Thanksquote: Originally posted by harsh_athalye
select sum(1) from table ORSELECT rows FROM sysindexes WHERE id = OBJECT_ID('Sometable') AND indid < 2Note: Second alternative may not give accurate results.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED"
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2008-05-09 : 00:35:23
|
| Why? Count(*) is the proper way |
 |
|
|
|
|
|