Datasheet

Chapter 1: Being Objective: Re-Examining Objects in SQL Server
Data Type Name Class Size in Bytes Nature of the Data
DateTime
Date/Time 8 Date and time data from January 1, 1753,
to December 31, 9999, with an accuracy of
three-hundredths of a second.
DateTime2
Date/Time Varies (6-8) Updated incarnation of the more
venerable
DateTime
data type. Supports
larger date ranges and large time fraction
precision (up to 100 nanoseconds). Like
DateTime
, it is not time zone aware, but,
does align with the .NET
DateTime
data
type.
SmallDateTime
Date/Time 4 Date and time data from January 1, 1900,
to June 6, 2079, with an accuracy of one
minute.
DateTimeOffset
Date/Time Varies (8-10) Similar to the
DateTime
data type, but
also expects an offset designation of
14:00 to +14:00 offset from UTC time.
Time is stored internally as UTC time,
and any comparisons, sorts, and indexing
will be based on that unified time zone.
Date
Date/Time 3 Stores only
Date
data from January 1,
0001, to December 31, 9999 as defined by
the Gregorian calendar. Assumes the
ANSI standard date format
(YYYY-MM-DD), but will implicitly
convert from several other formats.
Time
Date/Time Varies (3-5) Stores only
Time
data in user-selectable
precisions as granular as 100 nanoseconds
(which is the default).
Cursor
Special
Numeric
1 Pointer to a cursor. While the pointer
takes up only a byte, keep in mind that
the result set that makes up the actual
cursor also takes up memory exactly
how much will vary depending on the
result set.
Timestamp/
rowversion
Special
Numeric
(binary)
8 Special value that is unique within a
given database. Value is set by the
database itself automatically every time
the record is either inserted or
updated — even though the timestamp
column wasn’t referred to by the
UPDATE
statement (you’re actually not allowed to
update the timestamp field directly).
Continued
13