The programming features of the Microsoft SQL Server ODBC Driver for Linux are based on ODBC in SQL Server Native Client (SQL Server Native Client (ODBC)). SQL Server Native Client is based on ODBC in Windows Data Access Components (ODBC Programmer's Reference).
Your ODBC application can use Multiple Active Result Sets (MARS) and other SQL Server specific features by including /opt/microsoft/sqlncli/11.0.1790.0/sqlncli.h after including the unixODBC headers (sql.h, sqlext.h, sqltypes.h, and sqlucode.h). Then use the same symbolic names for SQL Server specific items that you would in your Windows ODBC applications.
Available Features
In the SQL Server Native Client documentation for ODBC (SQL Server Native Client (ODBC)), the following sections in the documentation should be valid when using the Microsoft SQL Server ODBC Driver for Linux:
Features That Are Not Available
The following features are not available in this release of the Microsoft SQL Server ODBC Driver for Linux:
bulk copy function (bcp_batch, for example)
distributed transactions (SQL_ATTR_ENLIST_IN_DTC attribute is not supported)
database mirroring
FILESTREAM
profiling ODBC driver performance, discussed in SQLSetConnectAttr, the following performance-related connection attributes:
SQL_COPT_SS_PERF_DATA
SQL_COPT_SS_PERF_DATA_LOG
SQL_COPT_SS_PERF_DATA_LOG_NOW
SQL_COPT_SS_PERF_QUERY
SQL_COPT_SS_PERF_QUERY_INTERVAL
SQL_COPT_SS_PERF_QUERY_LOG
SQLBrowseConnect
table-valued parameters (TVPs)
The SQL_ATTR_ENLIST_IN_DTC attribute is not supported.
C interval types such as SQL_C_INTERVAL_YEAR_TO_MONTH (documented in Data Type Identifiers and Descriptors) are not currently supported.
Character Support
SQLCHAR data must be UTF-8. SQLWCHAR data must be UTF-16LE (Little Endian).
If you have not called SQLDescribeParameter to specify a SQL type on the server, the driver will use the SQL type specified in the ParameterType parameter of SQLBindParameter. If a narrow character SQL type, such as SQL_VARCHAR, is specified in SQLBindParameter, the driver will convert the supplied UTF-8 data to the default SQL Server code page, which is typically code page 1252. This might result in data loss. If some characters cannot be represented in code page 1252 they will be converted to question mark characters ('?'). To avoid this data loss, specify a Unicode SQL character type, such as SQL_NVARCHAR, in SQLBindParameter. In this case, the supplied Unicode data in UTF-8 encoding will be converted to UTF-16 without loss of precision.
There is a text-encoding conversion difference between Windows and the iconv library on Linux, which is used by the SQL Server ODBC Driver for Linux. Text data that is encoded in codepage 1255 (Hebrew) has one code point (0xCA) that behaves differently on the two platforms. Converting to Unicode on Windows produces a UTF-16 code point of 0x05BA. Converting to Unicode on Linux produces a UTF-16 code point of 0x00CA. This should not be an issue because code point 0xCA in codepage 1255 is not defined to be a character, but this can affect an application that includes logic that uses this undefined code point.
When UTF-8 multibyte characters or UTF-16 surrogates are split across SQLPutData buffers, it results in data corruption. You must use buffers for streaming SQLPutData that do not end in partial character encodings.
Other Issues
You can make a dedicated administrator connection (DAC) using SQL Server authentication and host,port. A member of the Sysadmin role first needs to discover the DAC port. For example, if the DAC port were 33000 you could connect to it with sqlcmd as follows:
Copy Code
sqlcmd –U <user> -P <pwd> -S <host>,33000
The UnixODBC driver manager returns "invalid attribute/option identifier" for all statement attributes when they are passed through SQLSetConnectAttr. On Windows, when SQLSetConnectAttr receives a statement attribute value, it causes the driver to set that value on all currently-active statements that are children of the connection handle.
Note
In this first release of the driver, DAC connections must use SQL Server Authentication.