systypes

All databases

Description

systypes contains one row for each system-supplied and user-defined datatype. Domains (defined by rules) and defaults are given, if they exist.

The rows that describe system-supplied datatypes cannot be altered.

Columns

The columns for systypes are:

Name

Datatype

Description

uid

int

User ID of datatype creator

usertype

smallint

User type ID

variable

bit

1 if datatype is variable length; 0 otherwise

allownulls

bit

Indicates whether nulls are allowed for this datatype

type

tinyint

Physical storage datatype

length

int

Physical length of datatype

tdefault

int

ID of system procedure that generates default for this datatype

domain

int

ID of system procedure that contains integrity checks for this datatype

name

sysname

Datatype name

printfmt

varchar(255)

Reserved

prec

tinyint

Number of significant digits

scale

tinyint

Number of digits to the right of the decimal point

ident

tinyint

1 if column has the IDENTITY property, 0 if it does not

hierarchy

tinyint

Precedence of the datatype in mixed mode arithmetic

accessrule

int

The object ID of the access rule in sysprocedures.

xtypeid

int

The internal class ID

xdbid

int

The dbid where a class is installed:

  • -1 = the system database

  • -2 = the current database, or any dbid

Table 12-26 lists each system-supplied datatype’s name, hierarchy, type (not necessarily unique), and usertype (unique). The datatypes are ordered by hierarchy. In mixed-mode arithmetic, the datatype with the lowest hierarchy takes precedence:

Table 12-26: Datatype names, hierarchy, types, and usertypes

Name

hierarchy

type

usertype

floatn

1

109

14

float

2

62

8

datetimn

3

111

15

datetime

4

61

12

real

5

59

23

numericn

6

108

28

numeric

7

63

10

decimaln

8

106

27

decimal

9

55

26

moneyn

10

110

17

money

11

60

11

smallmoney

12

122

21

smalldatetime

13

58

22

intn

14

38

13

int

15

56

7

smallint

16

52

6

tinyint

17

48

5

bit

18

50

16

univarchar

19

155

35

unichar

20

135

34

reserved

21

varchar

22

39

2

sysname

22

39

18

nvarchar

22

39

25

char

23

47

1

nchar

23

47

24

varbinary

24

37

4

timestamp

24

37

80

binary

25

45

3

text

26

35

19

image

27

34

20

Indexes

Unique clustered index On name

Unique nonclustered index On usertype