SQL Flow Field Guide

char & varchar (data type)

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

data type char & varchar

What changes

Input
none
Output or change
none

Syntax at a glance

char [ ( n ) ] | varchar [ ( n | max ) ]

Work example

Store non-Unicode text or UTF-8 text under a matching collation.

Use varchar for variable-width values and select a UTF-8 collation when the text must hold Unicode.

Check your work varchar capacity is measured in bytes, so character capacity depends on the encoding and collation.

Practice SQL

Open in SQL Flow
SELECT CAST('North' AS varchar(20)) AS region_name;

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