Hi all please could any one can tell that which system table have could get the results as function COUNT(*). I mean if do not want to use COUNT(*) rather this column(s) from system table to produce same as COUNT(*) funcction. Thanks...
sysindexes. But it is not guaranteed to be correct all the time -- Frank Kalis Moderator Microsoft SQL Server MVP Webmaster:http://www.insidesql.de
AFAIK... Select Object_Name(id) AS ObjectName, rowcnt AS RowCnt From Sysindexes Where Object_Name(id) = 'TableName'
quote:Originally posted by sonnysingh please could any one can tell that which system table have could get the results as function COUNT(*). I mean if do not want to use COUNT(*) rather this column(s) from system table to produce same as COUNT(*) funcction. Seehttp://toponewithties.blogspot.com/2004/08/let-us-count-them.html for a number of options. Roji. P. Thomas Microsoft SQL Server MVP http://toponewithties.blogspot.com
DBCC UPDATEUSAGE (0) This would guarantee the rowcount is up-to-date... and then use this statement SELECT object_name(id) [TableName] ,rowcnt [Rows] FROM sysindexes WHERE object_name(id) IN (SELECT Name FROM sysobjects WHERE type = 'u') AND IndID IN (0,1) ORDER BY object_name(id) Thanks, Ram "It is easy to write code for a spec and walk in water, provided, both are freezed..."