SQL Flow Field Guide

| (Bitwise OR)

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

operator | (Bitwise OR)

What changes

Input
operand expressions
Output or change
computed value
Return type
Returns an int if the input values are int, a smallint if the input values are smallint, or a tinyint if the input values are tinyint.

Syntax at a glance

expression | expression

Work example

A flag field needs | (Bitwise OR) to test or change a specific bit mask.

Use small integer values with one bit set at a time. Compare the mask before and after the expression.

Check your work | (Bitwise OR). The result of | (Bitwise OR) changes only the intended bit and keeps unrelated flags intact.

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