Categories:

Data metric functions

ROW_COUNT (system data metric function)¶

Returns the total number of rows in a table.

Syntax¶

Not applicable.

Returns¶

The function returns a scalar value with a NUMBER data type.

Access control requirements¶

Associating and running a system DMF requires the USAGE privilege on the system DMF. You can grant the SNOWFLAKE.DATA_METRIC_USER database role to give users the USAGE privilege on all system DMFs. For more information, see Grant the USAGE privilege on system DMFs.

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes¶

You can’t call this function directly. To learn how to associate the function with a table or view so it runs at regular intervals, see Associate a DMF to automate data quality checks.