Click here to Skip to main content
15,904,416 members
Articles / Database Development / SQL Server

A better way to count(*)

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
8 Jun 2010CPOL 7.1K   5  
Or, assuming your table has an index, you could do this "old-school" as:select MAX(rows) from sysindexes where id = Object_ID('{tablename}')

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United States United States
Starting developing in 1980's using Basic, MSC 5.0, Btrieve and DBFs. Back when men were men and there were no wizards. Since then, I have developed payroll processing system, general ledger packages, billing systems, project accounting systems, order entry, a report writer, email systems, development frameworks, C++ based Web Application Server and others that have long been forgotten.

Professionally, I have been a developer, sr. developer, development lead, architect, chief architect, CTO, director of development, and consultant. I am also in charge of changing the bottled water when empty.

Comments and Discussions