Number of Records Returned By a Query

Number of Records Returned By a Query

How can I get the number of records returned by a query without cycling through all the records and counting each one?

Have you tried SELECT COUNT(*) FROM MyTable ? Alternatively, I think the number of rows is stored in sysxindexes.


About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist