Datasheet

Chapter 1: Being Objective: Re-Examining Objects in SQL Server
Data Type Name Class Size in Bytes Nature of the Data
UniqueIdentifier
Special
Numeric
(binary)
16 Special Globally Unique Identifier
(GUID). Is guaranteed to be unique across
space and time.
Char
Character Varies Fixed-length character data. Values
shorter than the set length are padded
with spaces to the set length. Data is
non-Unicode. Maximum specified length
is 8,000 characters.
VarChar
Character Varies Variable-length character data. Values are
not padded with spaces. Data is
non-Unicode. Maximum specified length
is 8,000 characters, but you can use the
‘‘max’’ keyword to indicate it as
essentially a very large character field (up
to 2
ˆ
31 bytes of data).
Text
Character Varies Legacy support as of SQL Server
2005 — use
varchar(max)
instead!
NChar
Unicode Varies Fixed-length Unicode character data.
Values shorter than the set length are
padded with spaces. Maximum specified
length is 4,000 characters.
NVarChar
Unicode Varies Variable-length Unicode character data.
Values are not padded. Maximum
specified length is 4,000 characters, but
you can use the ‘‘max’’ keyword to
indicate it as essentially a very large
character field (up to 2
ˆ
31 bytes of
data).
Ntext
Unicode Varies Like the
Text
data type, this is legacy
support only in this case, use
nvarchar(max)
. Variable-length Unicode
character data.
Binary
Binary Varies Fixed-length binary data with a
maximum length of 8,000 bytes.
VarBinary
Binary Varies Variable-length binary data with a
maximum specified length of 8,000 bytes,
but you can use the ‘‘max’’ keyword to
indicate it as essentially a LOB field (up
to 2
ˆ
31 bytes of data).
Image
Binary Varies Legacy support only as of SQL Server
2005. Use
varbinary(max)
instead!
14