Tuesday, June 14, 2011

Do not use select count(*) from table_name to find the number of rows in a table

If you have multi million/billion rows in your table. Do not use select count(*) from table_name to find the number of rows in a table instead you can try to use sp_spaceused 'table_name' It is much quicker than select count(*).