What is an alternative way of Retrieving Table Row Count without using Count function?

 Posted by vishalneeraj-24503 on 12/2/2014 | Category: Sql Server Interview questions | Views: 341 | Points: 40
Answer:

Write below query:-
Write below queries:-
select convert(bigint,rows)

from sysindexes
where id = object_id('Test1')
and indid < 2;

--OR--

select sum(row_count)
from sys.dm_db_partition_stats
WHERE object_id=OBJECT_ID('Test1')
AND (index_id = 0 or index_id = 1);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response