List out 3 ways to get an accurate count of the number of records in a table?
Pankaj Pathak
1. select COUNT(1) from Table 2. select COUNT(*) from Table 3. select * from Table4.select SUM (row_count) FROM sys.dm_db_partition_stats WHERE object_id=OBJECT_ID('table') AND (index_id=0 or index_id=1);5.SELECT rows FROM sysindexes WHERE id = OBJECT_ID('Table') AND indid < 26. SELECT CAST(p.rows AS float) FROM sys.tables AS tbl INNER JOIN sys.indexes AS idx ON idx.object_id = tbl.object_id and idx.index_id < 2 INNER JOIN sys.partitions AS p ON p.object_id=CAST(tbl.object_id AS int) AND p.index_id=idx.index_id WHERE ((tbl.name=N'Table' AND SCHEMA_NAME(tbl.schema_id)='dbo'))