Range and Storage Size

The range of valid values and storage size differ with each system-supplied datatypes.

For simplicity, the datatypes are printed in lowercase characters, although the SAP ASE server allows you to use either uppercase or lowercase characters for system datatypes.

User-defined datatypes, such as timestamp, are case-sensitive. Most SAP ASE-supplied datatypes are not reserved words; you can use them to name other objects.

Range and Storage Size of Exact Numeris Integer System Datatypes

Datatype

Synonyms

Range

Bytes of Storage

bigint

Whole numbers between 263 and -263 - 1 (from -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807, inclusive.

8

int

integer

231 -1 (2,147,483,647) to -231 (-2,147,483,648

4

smallint

215 -1 (32,767) to -215 (-32,768)

2

tinyint

0 to 255 (Negative numbers are not permitted)

1

unsigned bigint

Whole numbers between 0 and 18,446,744,073,709,551,615

8

unsigned int

Whole numbers between 0 and 4,294,967,295

4

unsigned smallint

Whole numbers between 0 and 65535

2

Range and Storage Size of Exact Numeric Decimal System Datatypes

Datatype

Synonyms

Range

Bytes of storage

numeric (p, s)

1038 -1 to -1038

2 to 17

decimal (p, s)

dec

1038 -1 to -1038

2 to 17

Range and Storage Size of Approximate Numeric System Datatypes

Datatype

Synonyms

Range

Bytes of storage

float (precision)

machine dependent

  • 4 for default precision < 16

  • 8 for default precision >= 16

double precision

machine dependent

8

real

machine dependent

4

Range and Storage Size of Money Datatypess

Datatype

Synonyms

Range

Bytes of storage

smallmoney

214,748.3647 to -214,748.3648

4

money

922,337,203,685,477.5807 to -922,337,203,685,477.5808

8

Range and Storage Size of Date/Time System Datatypes

Datatype

Synonyms

Range

Bytes of storage

smalldatetime

January 1, 1900 to June 6, 2079

4

datetime

January 1, 1753 to December 31, 9999

8

date

January 1, 0001 to December 31, 9999

4

time

12:00:00AM to 11:59:59:990PM

4

bigdatetime

January 1, 0001 to December 31, 9999 and 12:00.000000AM to 11:59:59.999999 PM

8

bigtime

12:00:00.000000 AM to 11:59:59.999999 PM

8

Range and Storage Size of Character System Datatypes

Datatype

Synonyms

Range

Bytes of storage

char(n)

character

pagesize

n

varchar(n)

character varying, char varying

pagesize

actual entry length

unichar

Unicode character

pagesize

n * @@unicharsize (@@unicharsize equals 2)

univarchar

Unicode character varying, char varying

pagesize

actual number of characters * @@unicharsize

nchar(n)

national character, national char

pagesize

n * @@ncharsize

nvarchar(n)

nchar varying, national char varying, national character varying

pagesize

@@ncharsize * number of characters

text

231 -1 (2,147,483,647) bytes or fewer

0 when uninitialized; multiple of 2K after initialization

unitext

1 – 1,073,741,823

0 when uninitialized; multiple of 2K after initialization

Range and Storage Size of Binary System Datatypes

Datatype

Synonyms

Range

Bytes of storage

binary(n)

pagesize

n

varbinary(n)

pagesize

actual entry length

image

231 -1 (2,147,483,647) bytes or fewer

0 when uninitialized; multiple of 2K after initialization

Range and Storage Size of Bit System Datatypes

Datatype

Synonyms

Range

Bytes of storage

bit

0 or 1

1 (one byte holds up to 8 bit columns)