SQL Flow Field Guide

ROWCOUNT_BIG

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

reads prior-statement state

What changes

Input
row count of the previous statement
Output or change
bigint
Return type
bigint

Syntax at a glance

ROWCOUNT_BIG ( )

Work example

Read the prior statement affected-row count when it might exceed int.

Read state in the intended scope and immediately after the statement it describes. Treat host values as untrusted.

Check your work Capture immediately because later statements can replace the count.

Open Microsoft Learn for full syntax, permissions, and details for your version.