Microsoft SQL Server Data Types and SQLFLEX Driver - cDbUpdateFunctionLibrary


The table show how SQL data types maps to DataFlex native types and the max capacity of each type.  The capacity shown is the highest possible value for the DataFlex side - or if the SQL side max value is lower - the SQL side capacity. Mostly it is the DataFlex side that has the lower capacity value.


SQL Type Name

SQL Type Constant

DataFlex Type

DataFlex Type

Constant

Capacity






bigint

eSQLServer_BIGINT

Numeric

DF_BCD

14.0

binary

eSQLServer_BINARY

Binary

DF_BINARY

8000

bit

eSQLServer_BIT

ASCII

DF_ASCII

1.0

char

eSQLServer_CHAR

Text

DF_TEXT

8000

date

eSQLServer_DATE

Date

DF_DATE

6.0

datetime

eSQLServer_DATETIME

DateTime

DF_DATETIME

23.3

datetime2

eSQLServer_DATETIME2

DateTime

DF_DATETIME

23.6

datetimeoffset

eSQLServer_DATETIMEOFFSET

DateTime

DF_DATETIME

23.0

decimal

eSQLServer_DECIMAL

Numeric

DF_BCD

14.8

double

eSQLServer_DOUBLE

Numeric

DF_BCD

14.8

float

eSQLServer_FLOAT

Numeric

DF_BCD

14.8

int

eSQLServer_INTEGER

Numeric

DF_BCD

11.0

nchar

eSQLServer_NCHAR

Text

DF_TEXT

4000

ntext

eSQLServer_NTEXT

Text

DF_TEXT

16384

numeric

eSQLServer_NUMERIC

Numeric

DF_BCD

14.8

nvarchar

eSQLServer_NVARCHAR

Text

DF_TEXT

4000

nvarchar(max)

eSQLServer_NVARCHARMAX

Text

DF_TEXT

16384

real

eSQLServer_REAL

Numeric

DF_BCD

14.8

smalldatetime

eSQLServer_SMALLDATETIME

DateTime

DF_DATETIME

23.0

smallint

eSQLServer_SMALLINT

Numeric

DF_BCD

6.0

text

eSQLServer_TEXT

Text

DF_TEXT

8000

time

eSQLServer_TIME

ASCII

DF_ASCII

16.0

timestamp

eSQLServer_TIMESTAMP

ASCII

DF_ASCII

8.0

tinyint

eSQLServer_TINYINT

Numeric

DF_BCD

3.0

uniqueidentifier

eSQLServer_GUID

ASCII

DF_ASCII

38

varbinary

eSQLServer_VARBINARY

Binary

DF_BINARY

8000

varbinary(max)

eSQLServer_VARBINARYMAX

Binary

DF_BINARY

16384

varchar

eSQLServer_VARCHAR

Text

DF_TEXT

8000

varchar(max)

eSQLServer_VARCHARMAX

Text

DF_TEXT

16384

sql_variant

eSQLServer_SQLVARIANT

Binary

DF_BINARY

16384

xml

eSQLServer_XML

Text

DF_TEXT

16384