SQL Flow Field Guide

binary & varbinary (data type)

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

data type binary & varbinary

What changes

Input
none
Output or change
none

Syntax at a glance

binary [ ( n ) ] | varbinary [ ( n | max ) ]

Work example

Store byte sequences such as a digest or an encoded payload.

Choose fixed or varying length from the format and keep the encoding contract outside the bytes.

Check your work Binary data is not text, and implicit character conversions can change its meaning.

Practice SQL

Open in SQL Flow
SELECT CAST(0x4A6F62 AS varbinary(8)) AS payload;

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