SQL Flow Field Guide

% Modulus

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

operator % Modulus

What changes

Input
operand expressions
Output or change
computed value

Syntax at a glance

dividend % divisor

Work example

A calculation needs % Modulus with explicit input types and bounds.

Try a positive value, a negative value, and a boundary value. Check overflow, precision, and type conversion.

Check your work % Modulus. The result of % Modulus has the expected sign, precision, and range.

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