Give 3 ways to get an accurate count of the number of records in a table ?

 Posted by Bharathi Cherukuri on 3/17/2012 | Category: Sql Server Interview questions | Views: 3734 | Points: 40
Answer:

The 3 ways to get an accurate count of the number of records in a table are as below:

1) SELECT * FROM table1

2) SELECT COUNT(*) FROM table1

3) SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND indid < 2


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response