Nulls require variable-length datatypes

Only columns with variable-length datatypes can store null values. When you create a NULL column with a fixed-length datatype, Adaptive Server converts it to the corresponding variable-length datatype. Adaptive Server does not inform you of the type change.

Table 8-2 lists the fixed-length datatypes and the variable-length datatypes to which Adaptive Server converts them. Certain variable-length datatypes, such as moneyn, are reserved; you cannot use them to create columns, variables, or parameters.

Table 8-2: Conversion of fixed-length to variable-length datatypes

Original fixed-length datatype

Converted to

char

varchar

nchar

nvarchar

unichar

univarchar

binary

varbinary

datetime

datetimn

float

floatn

bigint, int, smallint, tinyint,

intn

unsigned bigint, unsigned int, and unsigned smallint

uintn

decimal

decimaln

numeric

numericn

money and smallmoney

moneyn

Data entered into char, nchar, unichar, and binary columns follows the rules for variable-length columns, rather than being padded with spaces or zeros to the full length of the column specification.