SQL Flow Field Guide

BASE64_ENCODE

Catalog support for SQL Server 2025 (17.x)

string transform

What changes

Input
string arguments
Output or change
string or integer
Return type
varchar(8000) if the input is varbinary(n) where n <= 6000. varchar(max) if the input is varbinary(n) where n > 6000. varchar(max) if the input is varbinary(max). If the input expression is NULL, the

Syntax at a glance

BASE64_ENCODE (expression [ , url_safe ] )

Work example

Encode bytes as base64 for a text-only transport field.

Test Unicode, trailing spaces, collation, empty input, and maximum output length.

Check your work Keep the source binary type and treat the result as transport text, not encryption.

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