类似于java中的基本数据类型转换
列出类型层次关系:
name hierarchy
---- -----------
floatn 1
float 2
datetimn 3
datetime 4
real 5
numericn 6
numeric 7
decimaln 8
decimal 9
moneyn 10
money 11
smallmoney 12
smalldatetime 13
intn 14
int 15
smallint 16
tinyint 17
bit 18
univarchar 19
unichar 20
sysname 22
varchar 22
nvarchar 22
char 23
nchar 23
timestamp 24
varbinary 24
binary 25
text 26
image 27
date 28
time 29
daten 30
timen 31
extended type 99
例如:smallint(c1)*int(c2)最后结果为int型,因为int的hierarchy值为15,而smallint为16.
select name, hierarchy from systypes order by hierarchy;
列出类型层次关系:
name hierarchy
---- -----------
floatn 1
float 2
datetimn 3
datetime 4
real 5
numericn 6
numeric 7
decimaln 8
decimal 9
moneyn 10
money 11
smallmoney 12
smalldatetime 13
intn 14
int 15
smallint 16
tinyint 17
bit 18
univarchar 19
unichar 20
sysname 22
varchar 22
nvarchar 22
char 23
nchar 23
timestamp 24
varbinary 24
binary 25
text 26
image 27
date 28
time 29
daten 30
timen 31
extended type 99
例如:smallint(c1)*int(c2)最后结果为int型,因为int的hierarchy值为15,而smallint为16.