• For SQL Server 2005 and greater - there is no need to cursor at all. Just use the DMV sys.dm_db_partition_stats as in the following:

    Select object_schema_name(object_id) As SchemaName

    ,object_name(object_id) As ObjectName

    ,row_count

    From sys.dm_db_partition_stats

    Where index_id < 2

    And object_schema_name(object_id) <> 'sys'

    Order By object_schema_name(object_id);

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs