SQL Flow Field Guide

System functions (overview)

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

none (documentation, rules or examples)

What changes

Input
none
Output or change
none

Syntax at a glance

n/a (reference page)

Work example

Read current statement, error, session, or transaction state while diagnosing a query.

Capture values such as @@ROWCOUNT immediately and use TRY...CATCH for error handling.

Check your work Many system values describe only the most recent statement or current scope.

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