Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 2.65 KB

string-and-binary-types.md

File metadata and controls

36 lines (30 loc) · 2.65 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic helpviewer_keywords dev_langs monikerRange
String and Binary Types
Learn about the string and binary types in the Database Engine, including binary, varbinary, char, nchar, varchar, and nvarchar.
MikeRayMSFT
mikeray
randolphwest
09/22/2022
sql
t-sql
reference
data types [SQL Server]
LOB data [SQL Server]
TSQL
>=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current||=fabric

String and binary types

[!INCLUDE sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw]

[!INCLUDEssNoVersion] supports the following string and binary types.

Type Description
binary and varbinary Binary data types of either fixed length or variable length. Converting data to the binary and varbinary data types is useful if binary data is the easiest way to move around data.
char and varchar Character data types that are either fixed-size, char, or variable-size, varchar.

Starting with [!INCLUDEsql-server-2019], when a UTF-8 enabled collation is used, these data types store the full range of Unicode character data and use the UTF-8 character encoding.
nchar and nvarchar Unicode character data types that are either fixed-size, nchar, or variable-size, nvarchar.

Starting with [!INCLUDEssSQL11], when a Supplementary Character (SC) enabled collation is used, these data types store the full range of Unicode character data and use the UTF-16 character encoding.
ntext, text, and image Fixed and variable-length data types for storing large non-Unicode and Unicode character and binary data. Unicode data uses the Unicode UCS-2 character set.

The ntext, text, and image data types will be removed in a future version of [!INCLUDE ssnoversion-md]. Avoid using these data types in new development work, and plan to modify applications that currently use them.

See also