how to speed up count of sql function code example
Example: fast sql column count
SELECT
Total_Rows= SUM(st.row_count)
FROM
sys.dm_db_partition_stats st
WHERE
object_name(object_id) = 'PUMP' AND (index_id < 2)
SELECT
Total_Rows= SUM(st.row_count)
FROM
sys.dm_db_partition_stats st
WHERE
object_name(object_id) = 'PUMP' AND (index_id < 2)