Supported Data Types and Data Type Mappings
The following tables show the data type mappings that are performed when remote data access (RDA) is used to access data in a Microsoft® SQL Server™ database.
| SQL Server data type | SQL Server CE data type |
| bigint (int 8) | bigint (int 8) |
| binary (n) | binary (n) or image
If the length of the data is 510 bytes or less, RDA maps the SQL Server binary data to the Microsoft SQL Server 2000 Windows® CE Edition (SQL Server CE) binary. If the data is more than 510 bytes, RDA maps it to SQL Server CE image.
If the length of the image data exceeds the length of the binary column, pushing tracked data back to SQL Server fails. |
| bit | bit |
character
(synonym: char) | national character or ntext
If the length of the data is 255 characters or less, RDA maps the SQL Server character data to SQL Server CE national character. If the data is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character column, pushing tracked data back to SQL Server fails. |
character varying
(synonyms: char varying varchar) | national character varying or ntext
If the length of the data is 255 characters or less, RDA maps the SQL Server character varying data to SQL Server CE national character varying. If the data is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the character varying column, pushing tracked data back to SQL Server fails. |
| datetime | datetime |
| decimal | See numeric. |
| double precision | double precision |
| float | float |
| image | image |
integer (int 4)
(synonym: int) | integer (int 4) |
| money | money |
national character
(synonyms: national character, nchar) | national character
If the length of the data is 255 characters or less, RDA maps the SQL Server national character data to SQL Server CE national character. If the data is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character column, pushing tracked data back to SQL Server fails. |
| ntext | ntext |
numeric
(synonyms: decimal, dec) | numeric |
national character varying
(synonyms: national char varying, nvarchar) | national character varying
If the data length is 255 characters or less, RDA maps the SQL Server national character varying data to SQL Server CE national character varying. If the data is more than 255 characters, RDA maps it to SQL Server CE ntext.
If the length of the ntext data exceeds the length of the national character varying column, pushing tracked data back to SQL Server fails. |
| real | real |
| smalldatetime | datetime
If the precision of the datetime data exceeds the precision of the smalldatetime column, pushing tracked data back to SQL Server fails. |
| smallint (int 2) | smallint (int 2) |
| smallmoney | money
If the precision of the money data exceeds the precision of the smallmoney column, pushing tracked data back to SQL Server fails. |
| sql_variant | Not supported
The Pull method fails if the recordset contains a column with the data type sql_variant. |
| text | ntext
If the length of the text data exceeds 1,073,741,823 characters, pulling data from SQL Server fails. |
| timestamp | Not supported
The Pull method fails if the recordset contains a timestamp column. |
| tinyint (int 1) | tinyint (int 1) |
| uniqueidentifier | uniqueidentifier |
| varbinary (n) | varbinary (n) or image
If the length of the data is 510 bytes or less, RDA maps the SQL Server varbinary data to SQL Server CE varbinary. If the data is more than 510 bytes, RDA maps it to SQL Server CE image.
If the length of the image data exceeds the length of the varbinary column, pushing tracked data back to SQL Server fails. |
Using Data Types
When possible, choose data types that are supported by both SQL Server and SQL Server CE. As a result, RDA does not have to perform data mapping. When this is not possible, your application should validate the values stored in SQL Server CE to ensure that RDA can map these values between SQL Server and SQL Server CE.
You cannot pull data from a table having a primary key of type char, nchar, varchar, or nvarchar with length greater than 255 characters. These column types are mapped to ntext, and a primary key cannot be created on an ntext column.