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.

You cannot alter the rows that describe system-supplied datatypes.

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 of 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

varchar(255)

Datatype name

printfmt

varchar(255) null

Reserved

prec

tinyint null

Number of significant digits

scale

tinyint null

Number of digits to the right of the decimal point

ident

tinyint null

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

hierarchy

tinyint null

Precedence of the datatype in mixed-mode arithmetic

xtypeid

int null

The internal class ID

xdbid

int null

The dbid where a class is installed:

  • -1 = the system database

  • -2 = the current database

accessrule

int null

The object ID of the access rule in sysprocedures

Table 1-29 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 1-29: 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

uintn

15

68

47

bigint

16

191

43

ubigint

17

67

46

int

18

56

7

uint

19

66

45

smallint

20

52

6

usmallint

21

65

44

tinyint

22

48

5

bit

23

50

16

univarchar

24

155

35

unichar

25

135

34

unitext

26

174

36

varchar

27

39

2

sysname

27

39

18

nvarchar

27

39

25

longsysname

27

39

42

char

28

47

1

nchar

28

47

24

varbinary

29

37

4

timestamp

29

37

80

binary

30

45

3

text

31

35

19

image

32

34

20

date

33

49

37

time

34

51

38

daten

35

123

39

timen

36

147

40

extended type

99

36

-1

Indexes