Retrieve number of records from the table

Posted by VIJI Saturday, July 4, 2009

There are many methods available to retrieve the number of records from the table.

Some of them are:



1.

SELECT COUNT(*)
FROM MyTable



2.

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




Both the above methods will return the number of records in the Sql Server table.

0 Responses to Retrieve number of records from the table

Post a Comment