Friday, May 17, 2013

Count of the number of records in a SQL Table


Name 3 ways to get an accurate count of the number of records in a SQL Table?


SELECT * FROM TableName


SELECT COUNT(*) FROM TableName


SELECT rows FROM sysindexes WHERE id = OBJECT_ID('TableName') AND indid < 2

No comments:

Post a Comment