Friday 30 March 2012

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

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

No comments:

Post a Comment