which is the most efficient query to find out the total number of rows in a table?
which is the most efficient query to find out the total number of rows in a table?
which is the most efficient query to find out the total number of rows in a table other than using - SELECT COUNT(*) ... in query
which is the most efficient query to find out the total number of rows in a table?
LuisLopezCarrete
See
http://toponewithties.blogspot.com/2004/08/let-us-count-them.html
Anilesh
can be retrieved there
.jmweekes
Adam Cogan
Shon
Agnes Pedoche
Matt150279
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=13097&SiteID=1
Amjith
Why do you not weant to use the Count(*). I guess this is the best way to count the rows in the table. If it os too slow for you and you need immediate results rather than waiting for rleased locks you can get the *approximat* value with specific WITH(NOLOCK) after the table which you want to count. Sure this will count *all* even rows being involved in a transaction and might be deleted, but this would be a workaround.
(In some cases you just need the approximat value.)
HTH, Jens Suessmeyer.
---
http://www.sqlserver2005.de
---