This appendix lists the Open Data Services datatypes. To use these datatypes, include the SRV.H header file in your program.
With Open Data Services, you can describe and return data of text and image datatypes. However, because Open Data Services does not support pointers, it can not support DB-Library functions that require pointers (for example, dbmoretext, dbwritetext, and dbtxtptr). DB-Library clients can bind and receive data of these types as long as they receive them using the non-text DB-Library functions.
SQL Server can send the following datatypes to an Open Data Services server application as part of a remote stored procedure call:
A hard-coded NULL passed to a remote stored procedure parameter or an extended stored procedure parameter is received by an Open Data Services application with the datatype SRVNULL. In the following example, the second parameter of the remote stored procedure p1 is received as a parameter of type SRVNULL to the Open Data Services rmt_srv application:
exec rmt_srv...p1 'arg1',null,'arg3'
A NULL value stored in a local variable and passed to a remote stored procedure parameter or an extended stored procedure parameter is received by an Open Data Services application with the datatype of the local variable. In the following example, the second parameter of the remote stored procedure p1 is received as a parameter of type SRVINTN by the Open Data Services rmt_srv application:
declare @v1 int select @v1 = NULL exec rmt_srv...p1 'arg1',@v1,'arg3'
For a detailed description of SQL Server datatypes, see the Microsoft SQL Server Transact-SQL Reference; for a detailed description of DB-Library datatypes, see the Microsoft SQL Server Programming DB-Library for C.
These are the Open Data Services datatypes:
Datatype | Description |
---|---|
SRVCHAR | Character datatype |
SRVVARCHAR | Variable-length character datatype |
SRVBINARY | Binary datatype |
SRVVARBINARY | Variable-length binary datatype |
SRVINT1 | 1-byte tinyint datatype |
SRVINT2 | 2-byte smallint datatype |
SRVINT4 | 4-byte int datatype |
SRVINTN | Tinyint, smallint, or int datatype, null values allowed |
SRVBIT | Bit datatype |
SRVDECIMAL | Decimal datatype |
SRVDECIMALN | Decimal datatype, null values allowed |
SRVNUMERIC | numeric datatype |
SRVNUMERICN | numeric datatype, null values allowed |
SRVMONEY4 | 4-byte smallmoney datatype |
SRVMONEY | 8-byte money datatype |
SRVMONEYN | Smallmoney or money datatype, null values allowed |
SRVFLT4 | 4-byte real datatype |
SRVFLT8 | 8-byte float datatype |
SRVFLTN | Real or float datatype, null values allowed |
SRVDATETIM4 | 4-byte smalldatetime datatype |
SRVDATETIME | 8-byte datetime datatype |
SRVDATETIMN | Smalldatetime or datetime datatype, null values allowed |
srvimage | Image datatype |
srvtext | Text datatype |
SRVNULL | null |
Open Data Services applications also use the same datatype definitions as DB-Library functions. For more information, see the Microsoft SQL Server Programming DB-Library for C.