SQL Flow Field Guide

@@TOTAL_ERRORS

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

server statistics

What changes

Input
server activity counters
Output or change
integer counter
Return type
integer

Syntax at a glance

@@TOTAL_ERRORS

Work example

Inspect cumulative disk read and write errors reported by the process.

Take two readings over a measured interval and account for instance restarts.

Check your work Compare interval snapshots and confirm underlying file and operating-system evidence.

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