When you issue a CREATE TABLE statement, SQL Anywhere automatically converts the data types to the corresponding Microsoft SQL Server data types. The following table describes the SQL Anywhere to Microsoft SQL Server data type conversions.
SQL Anywhere data type | Microsoft SQL Server default data type |
---|---|
bit | bit |
tinyint | tinyint |
smallint | smallint |
int | int |
bigint | numeric(20,0) |
decimal [defaults p=30, s=6] | decimal(prec, scale) |
numeric [defaults p=30 s=6] | numeric(prec, scale) |
float | if (prec) float(prec) else float |
real | real |
smallmoney | smallmoney |
money | money |
date | datetime |
time | datetime |
timestamp | datetime |
smalldatetime | datetime |
datetime | datetime |
char(n) | if (length > 255) text else varchar(length) |
character(n) | char(n) |
varchar(n) | if (length > 255) text else varchar(length) |
long varchar | text |
binary(n) | if (length > 255) image else binary(length) |
long binary | image |
double | float |
uniqueidentifierstr | uniqueidentifier |
The Microsoft SQL Server uniqueidentifier column is mapped to a SQL Anywhere uniqueidentifierstr column. The resulting string can be converted to a binary UUID value using the STRTOUUID function. See STRTOUUID function [String].