Data Types

To use the Open Data Services data types, include the Srv.h header file in your program. Open Data Services applications also use the same data type definitions as DB-Library functions.


Data type
SQL Server
data type

Description
SRVBIGBINARY binary binary data type, length 0 to 8000 bytes.
SRVBIGCHAR char character data type, length 0 to 8000 bytes.
SRVBIGVARBINARY varbinary Variable-length binary data type, length 0 to 8000 bytes.
SRVBIGVARCHAR varchar Variable-length character data type, length 0 to 8000 bytes.
SRVBINARY binary binary data type.
SRVBIT bit bit data type.
SRVBITN bit null bit data type, null values allowed.
SRVCHAR char character data type.
SRVDATETIME datetime 8-byte datetime data type.
SRVDATETIM4 smalldatetime 4-byte smalldatetime data type.
SRVDATETIMN datetime null smalldatetime or datetime data type, null values allowed.
SRVDECIMAL decimal decimal data type.
SRVDECIMALN decimal null decimal data type, null values allowed.
SRVFLT4 real 4-byte real data type.
SRVFLT8 float 8-byte float data type.
SRVFLTN real | float null real or float data type, null values allowed.
SRVIMAGE image image data type.
SRVINT1 tinyint 1-byte tinyint data type.
SRVINT2 smallint 2-byte smallint data type.
SRVINT4 int 4-byte int data type.
SRVINTN tinyint | smallint | int null tinyint, smallint, or int data type, null values allowed.
SRVMONEY4 smallmoney 4-byte smallmoney data type.
SRVMONEY money 8-byte money data type.
SRVMONEYN money | smallmoney null smallmoney or money data type, null values allowed.
SRVNCHAR nchar Unicode character data type.
SRVNTEXT ntext Unicode text data type.
SRVNUMERIC numeric numeric data type.
SRVNUMERICN numeric null numeric data type, null values allowed.
SRVNVARCHAR nvarchar Unicode variable-length character data type.
SRVTEXT text text data type.
SRVVARBINARY varbinary Variable-length binary data type.
SRVVARCHAR varchar Variable-length character data type.

Open Data Services Data Type Conversions

The following chart shows conversions allowed for Open Data Services data types. It does not include the following data types for which conversions are not supported: SRVGUID, SRVNTEXT, SRVBIGVARBINARY, SRVBIGVARCHAR, SRVBIGBINARY, SRVBIGCHAR, and SRVNCHAR.


(c) 1988-98 Microsoft Corporation. All Rights Reserved.