Character String DataTypes
The character string data types are used to store values that contain character strings.
VARCHAR data types contain ASCII character strings, NVARCHAR are used for storing Unicode character strings.
VARCHAR
The VARCHAR(n) data type specifies a variable-length character string, where n indicates the maximum length in bytes and is an integer between 1 and 5000. If the length is not specified, then the default is 1.
If the VARCHAR(n) data type is used in a DML query, for example CAST (A as VARCHAR(n)), <n> indicates the maximum length of the string in characters. SAP recommends using VARCHAR with ASCII characters based strings only. For data containing other characters, SAP recommends using the NVARCHAR data type instead.
NVARCHAR
The NVARCHAR(n) data type specifies a variable-length Unicode character set string, where <n> indicates the maximum length in characters and is an integer between 1 and 5000. If the length is not specified, then the default is 1.
ALPHANUM
The ALPHANUM(n) data type specifies a variable-length character string which contains alpha-numeric characters, where n indicates the maximum length and is an integer between 1 and 127.
Sorting among values of type ALPHANUM is performed in alpha-representation. In the case of a purely numeric value, this means that the value can be considered as an alpha value with leading zeros.
SHORTTEXT
The SHORTTEXT(n) data type specifies a variable-length character string which supports text search features and string search features. This data type can be defined for column tables, but not for row tables. This is not a standalone sql type. Selecting a SHORTTEXT(n) column yields a column of type NVARCHAR(n).