I used the built-in stored procedure sp_MSforeachtableto determine the number of rows of each table in our database using COUNT (*).
I realized that I just want 0 or 1, depending on whether there are any rows in the table.
Is there anything else I can use faster or cheaper than COUNT (*)?
source
share