Click to Rate and Give Feedback

  Switch on low bandwidth view
SQL Server CE Books Online
Data Types

Each column in a table in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) has a data type that specifies the type of data (such as integer, character, or money) that the column can hold.

Note  There may be minor differences between Microsoft SQL Server 2000 and SQL Server CE in the way data types are promoted when the execution of a function results in an overflow or underflow. You might have to perform explicit CAST in SQL Server 2000 to get the same behavior in SQL Server CE.

SQL Server CE supports the following data types.

Data type Description
bigint Integer (whole number) data from -2^63 (- 9,223,372,036,854,775,808) through 2^63-1 (9,223,372,036,854,775,807). Storage size is 8 bytes.
integer Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31 - 1 (2,147,483,647).
smallint Integer data from –32,768 to 32,767. Storage size is 2 bytes.
tinyint Integer data from 0 to 255. Storage size is 1 byte.
bit Integer data with either a 1 or 0 value.
numeric (p, s) Fixed-precision and scale-numeric data from -10^38 +1 through 10^38 –1. p specifies precision and can vary between 1 and 38. s specifies scale and can vary between 0 and p.
money Monetary data values from -2^63 (- 922,337,203,685,477.5808) through 2^63 - 1 (922,337,203,685,477.5807), with accuracy to a ten-thousandth of a monetary unit. Storage size is 8 bytes.
float Floating point number data from -1.79E + 308 through 1.79E + 308

Storage size is 8 bytes.

real Floating precision number data from -3.40E + 38 through 3.40E + 38.
datetime Date and time data from January 1, 1753, to December 31, 9999, with an accuracy of one three-hundredth second, or 3.33 milliseconds. Values are rounded to increments of .000, .003, or .007 milliseconds.

Stored as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system's reference date. Values for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight. Seconds have a valid range of 0 - 59.

national character(n)

Synonym:
nchar(n)

Fixed-length Unicode data with a maximum length of 255 characters.
Default length = 1
Storage size, in bytes, is two times the number of characters entered.
national character varying(n)

Synonym:
nvarchar(n)

Variable-length Unicode data with a length of 1 to 255 characters.
Default length = 1
Storage size, in bytes, is two times the number of characters entered.
ntext Variable-length Unicode data with a maximum length of (2^30 - 2) / 2 (536,870,911) characters. Storage size, in bytes, is two times the number of characters entered.
binary(n) Fixed-length binary data with a maximum length of 510 bytes. Default length = 1
varbinary(n) Variable-length binary data with a maximum length of 510 bytes. Default length = 1
image Variable-length binary data with a maximum length of 2^30 – 1 (1,073,741,823) bytes.
uniqueidentifier A globally unique identifier (GUID). Storage size is 16 bytes.
IDENTITY [(s, i)] This is a property of a data column, not a distinct data type.

Only data columns of the integer data types can be used for identity columns. A table can have only one identity column. A seed and increment can be specified and the column cannot be updated.

s (seed) = starting value

i (increment) = increment value

ROWGUIDCOL This is a property of a data column, not a distinct data type. It is a column in a table that is defined using the uniqueidentifier data type. A table can only have one ROWGUIDCOL column.
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker