Databases Reference
In-Depth Information
Table 8-2: Data Types (continued)
Group
Type name
Range
Storage
Comments
10
−
19 9 bytes
S (scale) The maximum
number of digits to the
right of the decimal point.
−
20
28 13 bytes
−
29
38 17 bytes
Money
−
922,337,203,685,
477.5808 to
922,337,203,
685,477.5807
8bytes
n/a
smallmoney
−
214,748.3648 to
214,748.3647
4bytes
n/a
Approximate
Numerics
Float(
n
)
−
1.79E
+
308 to
Nvalue
Storage
1
n/a
−
308, 0
and 2.23E
2.23E
−
−
308
−
24 4 bytes
to 1.79E
+
308
25
−
53 8 bytes
Real
−
3.40E
+
38 to
4bytes.
n/a
−
1.18E
−
38, 0
and 1.18E
−
38 to
3.40E
+
38
Date and time Datetime
January 1, 1753,
to December 31,
9999
8 bytes total.
Stored as 2 4
byte integers.
Accuracy is 3.33
milliseconds
smalldatetime
January 1, 1900,
to June 6, 2079
4 bytes total.
Stored as 2 2
byte integers.
Accuracy is 1 minute
Character
Char(
n
)
Non-Unicode
characters.
n
bytes
Fixed length. Always
occupies
n
bytes, even if
some bytes are unused.
Valid values for
n
range
from 1
−
8000.
Varchar(
n
)
Non-Unicode
characters
1byteforeach
stored
character.
Variable length. Valid
values for
n
range from
1
8000. If
n
is omitted the
default is 1. Unused bytes
do not occupy storage
space. However, 2
additional bytes are
added. These are used as
an offset indicating the
location of the string's
end. See ''Row Overflow
Considerations.''
−
Continued
Search WWH ::
Custom Search