Datasheet

Chapter 1: Being Objective: Re-Examining Objects in SQL Server
Explicit conversion
Implicit conversion
Conversion not allowed
Requires explicit CAST to prevent the loss of precision or scale that
might occur in an implicit conversion.
Implicit conversions between xml data types are supported only if the
source or target is untyped xml. Otherwise, the conversion must be explicit.
binary
varbinary
char
varchar
nchar
nvarchar
datetime
smalldatetime
date
time
datetimeoffset
datetime2
decimal
numeric
float
real
bigint
int(INT4)
smallint(INT2)
tinyint(INT1)
money
smallmoney
bit
timestamp
uniqueidentifier
image
ntext
text
sql_variant
xml
CLR UDT
hierarchyid
binary
varbinary
char
varchar
nchar
nvarchar
datetime
smalldatetime
date
time
datetimeoffset
datetime2
decimal
numeric
float
real
bigint
int(INT4)
smallint(INT2)
tinyint(INT1)
money
smallmoney
bit
timestamp
uniqueidentifier
image
ntext
text
sql_variant
xml
CLR UDT
hierarchyid
Figure 1-2
In short, data types in SQL Server perform much the same function that they do in other programming
environments. They help prevent programming bugs by ensuring that the data supplied is of the same
nature that the data is supposed to be (remember 1/1/1980 means something different as a date than as
a number) and ensures that the kind of operation performed is what you expect.
16