Preview Release of the SQL Server [C/C++] ODBC Driver for Linux

This has been re-posted from the SQL Server Team Blog.

In our continued commitment to interoperability, we are very excited to announce the availability of a preview release of the SQL Server ODBC Driver for Linux! This release will allow native developers to access Microsoft SQL Server from Linux operating systems. To assist our customers with native applications on multi-platform we have ported our existing, reliable and enterprise-class ODBC for Windows driver (a.k.a. SQL Server Native Client, or SNAC) to the Linux platform. Download the driver today here !

In this release, the SQL Server ODBC Driver for Linux will be a 64-bit driver for Red Hat Enterprise Linux 5. We will support SQL Server 2008 R2 and SQL Server 2012 with this release of the driver. Notable driver features (in addition to what you would expect in an ODBC driver) include support for the Kerberos authentication protocol, SSL and client-side UTF-8 encoding. This release also brings proven and effective tools and the BCP and SQLCMD utilities to the Linux world.

This SQL Server ODBC Driver for Linux provides a Microsoft-supported solution for C and C++ applications that target SQL Server. It also provides a mechanism for applications and runtimes that leverage ODBC to access SQL Server from Linux platforms. For customers who want to move from Sybase to SQL Server, the SQL Server ODBC Driver for Linux allows C and C++ code to continue running in Linux environments. For additional information on the first release of Microsoft ODBC Driver for Linux please refer to our ODBC Driver on Linux Documentation.

This release marks a big milestone in Microsoft’s continued commitment to interoperability and our alignment with ODBC as the preferred way to access SQL Server. Download the driver today; please provide your feedback and ask us questions via our forums; or post a comment via Microsoft Connect. We look forward to hearing from you.

Thanks,

Shekhar Joshi
Senior Program Manager
Microsoft SQL Server ODBC Driver For Linux

Comments

  • Anonymous
    December 15, 2011
    Can i include it in my app? Under which licence it released?

  • Anonymous
    December 29, 2011
    Hi I have two questions :

  1. I thought the sql native client drivers are only supported for RHEL 5.x (not even for RHEL 6)
  2. I am trying to build it using  (fedora core 13  , but when i try to connect to the database I always get connection error IM004 (SQLconnect error on SQL_HANDLE… , when tested using isql ). . I do not get why the connection problem (library installation error , odbc.ini or odbcinst.ini error or fedora 13 is not supported yet ? Can you share how you configure your odbc.ini and odbcinst.ini . When i switch on the trace the trace file shows : input handle of type 2 is allocated succesfully but the error comes within SQLConnect.c (I can ping my database server and connect to it successfully using freetds with unixodbc) ALso why sqlncli.h has been provided where we some attributes SQL_SOPT_SS_QUERYNOTIFICATION_xxx are defined , does that mean we the linux drivers does not support these features yet? Is there a way to verify the correctness of library installation and works by itself without using unixODBC I am trying to use the SQL native client with unixodbc because sql native client does supports some more features of the sql server (not sure if its true for linux driver but definitely for windows like query notifications and MARS). Thanks
  • Anonymous
    March 03, 2012
    please, make this PORTABLE... do not hardcode paths, use PREFIX to locate the driver file at will, etc ... This preview seems like a rushed out the door delivery... True, I am not using RedHat but I should have all necessary libraries in my system.  

  • Anonymous
    March 17, 2012
    When you will have a Mac OS X version driver?

  • Anonymous
    April 03, 2012
    Hi, After install, It fails with error - sqlcmd Unable to load SQLCMD resource file(s)  bcp Unable to load BCP resource DLL.  BCP cannot continue.

  • Anonymous
    April 03, 2012
    Hi Someone, Can you verify that you are using the released (RTM ) build ?  Based on the error message, it sounds like you might be using CTP release or possibly have both versions installed.   Can you run the following commands and send me the output: odbcinst -j   cat /etc/odbcinst.ini Thanks,

  • Greg
  • Anonymous
    April 16, 2012
    I installed the drivers on a clean version of RH EL 6.2.  They work but I was hoping that the MS Native drivers would allow me to retrieve the text fields that are defined as nvar(max) they don't.  When I try to select a nvar(max) type field I will first get an error saying that I need to allocate 4GB of memory for this operation but even if I allocate that much it just core dumps.  So I still have to cast those field types to text which converts any unicode only characters to a ?.  So I'm not sure what the native drivers give you that the FreeTDS drivers didn't.  It certainly is more difficult to install the MS drivers since you have to have a special version of unixODBC to run it though.  

  • Anonymous
    August 09, 2012
    Hi Guys, Great work on the Linux support... but come on!  RHEL5 or 6 only?  Special builds of unixODBC driver manager?  64-bit only? That's hardly better than the FreeTDS that we've been tolerating for years. Please get us a real ODBC driver that works with most default installs for unixODBC. Thanks, Brandon

  • Anonymous
    September 03, 2012
    When is the planned production release of the new driver

  • Anonymous
    September 04, 2012
    We have released the RTM in Mar 2012. You can download the driver from the link below www.microsoft.com/.../details.aspx

  • Anonymous
    September 05, 2012
    What happened to this project?  Is it shelfed or still going?  Are you still working on the 32 bit version and availability on other distros?

  • Anonymous
    September 30, 2012
    It's nice to have original ODBC driver for Linux, but what should we do with non-unicode databases? There is a problem with queries like SELECT 'Some cp1251 data' as 'field1', eventually we've got mojibake as a result.

  • Anonymous
    October 11, 2012
    We've had success with SELECT statements using the new driver, but INSERT statements are failing.  We are attempting to replace a third-party driver with this new one from Microsoft on a Linux server running a commercial ETL suite.  We can't see inside that commercial product, so we don't know the details of how it's trying to talk to ODBC. Following  are ODBC trace entries which seem to be associated with this failure.  Can anyone help me with this?  Thanks. [ODBC][13568][1344537102.881073][SQLAllocHandle.c][540] Entry: Handle Type = 3 Input Handle = 0x1d1077c0 [ODBC][13568][1344537102.881137][SQLAllocHandle.c][1083] Exit:[SQL_SUCCESS] Output Handle = 0x1dded290 [ODBC][13568][1344537102.881222][SQLPrepare.c][196] Entry: Statement = 0x1dded290 SQL = [INSERT INTO TEST_CONSTITUENT_BBDW(ID,KEYNAME,KEYNAMEPREFIX,FIRSTNAME,MIDDLENAME,MAIDENNAME,NICKNAME)  VALUES ( ?, ?, ?, ?, ?, ?,...][length = 132] [ODBC][13568][1344537102.881268][SQLPrepare.c][371] Exit:[SQL_SUCCESS] [ODBC][13568][1344537102.881318][SQLFreeStmt.c][144] Entry: Statement = 0x1dded290 Option = 0 [ODBC][13568][1344537102.881342][SQLFreeStmt.c][196]Error: IM001 [ODBC][13568][1344537102.881387][SQLError.c][352] Entry: Statement = 0x1dded290 SQLState = 0x448f6b60 Native = 0x448f6b68 Message Text = 0x448f68e0 Buffer Length = 511 Text Len Ptr = 0x448f6b6e [ODBC][13568][1344537102.881420][SQLError.c][389] Exit:[SQL_SUCCESS] SQLState = IM001 Native = 0x448f6b68 -> 0 Message Text = [[unixODBC][Driver Manager]Driver does not support this function] [ODBC][13568][1344537102.881475][SQLError.c][352] Entry: Statement = 0x1dded290 SQLState = 0x448f6b60 Native = 0x448f6b68 Message Text = 0x448f68e0 Buffer Length = 511 Text Len Ptr = 0x448f6b6e [ODBC][13568][1344537102.881501][SQLError.c][389] Exit:[SQL_NO_DATA] [ODBC][13568][1344537102.881526][SQLFreeStmt.c][144] Entry: Statement = 0x1dded290 Option = 1 [ODBC][13568][1344537102.881548][SQLFreeStmt.c][196]Error: IM001 [ODBC][13568][1344537102.881584][SQLError.c][352] Entry: Statement = 0x1dded290 SQLState = 0x448f6b60 Native = 0x448f6b68 Message Text = 0x448f68e0 Buffer Length = 511 Text Len Ptr = 0x448f6b6e [ODBC][13568][1344537102.881613][SQLError.c][389] Exit:[SQL_SUCCESS] SQLState = IM001 Native = 0x448f6b68 -> 0 Message Text = [[unixODBC][Driver Manager]Driver does not support this function] [ODBC][13568][1344537102.881645][SQLError.c][352] Entry: Statement = 0x1dded290 SQLState = 0x448f6b60 Native = 0x448f6b68 Message Text = 0x448f68e0 Buffer Length = 511 Text Len Ptr = 0x448f6b6e [ODBC][13568][1344537102.881669][SQLError.c][389] Exit:[SQL_NO_DATA]

  • Anonymous
    November 01, 2012
    Hi SQLNCli team, One questions burning under my nails: Is there any chance that Failover_Partner will be supported in future releases?

  • Anonymous
    December 05, 2012
    is there any way to use this a a perl driver? or will that be in a future release?

  • Anonymous
    October 03, 2013
    The comment has been removed

  • Anonymous
    June 26, 2015
    I am also facing issues with running sqlcmd. getting error " Unable to load SQLCMD resource file(s)" here is the extract of odbcinst -j unixODBC 2.3.0 DRIVERS............: /home/hsethi1/unixODBC-2.3.0/etc/odbcinst.ini SYSTEM DATA SOURCES: /home/hsethi1/unixODBC-2.3.0/etc/odbc.ini FILE DATA SOURCES..: /home/hsethi1/unixODBC-2.3.0/etc/ODBCDataSources USER DATA SOURCES..: /home/hsethi1/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8 Cat odbcinst.ini Description=Microsoft ODBC Driver 11 for SQL Server Driver=/home/hsethi1/unixODBC-2.3.0/opt/microsoft/msodbcsql/lib/libmsodbcsql-11.0.so.2270.0 Threading=1 UsageCount=2