The fastest way to get a table row count in SQL Server

While variations on select (xyz) from table all work, they all suffer from searching/scanning data and the overheads that incurs. The best mechanism I have found is;

EXEC sp_spaceused N'<schema>.<table name>’;

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s