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 (17)

  1. Someone says:

    Can i include it in my app? Under which licence it released?

  2. pp says:

    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

  3. Noeld says:

    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.  

  4. Rayman says:

    When you will have a Mac OS X version driver?

  5. Someone says:

    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.

  6. 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

  7. Steve Garrett says:

    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.  

  8. Brandon K says:

    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

  9. John C says:

    When is the planned production release of the new driver

  10. Shekhar Joshi - Microsoft says:

    We have released the RTM in Mar 2012.

    You can download the driver from the link below

    http://www.microsoft.com/…/details.aspx

  11. Kevin says:

    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?

  12. Daniil Megrabyan says:

    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.

  13. 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]

  14. Andreas J says:

    Hi SQLNCli team,

    One questions burning under my nails:

    Is there any chance that Failover_Partner will be supported in future releases?

  15. md says:

    is there any way to use this a a perl driver? or will that be in a future release?

  16. Kazma says:

    I was not able to execute the sqlcmd command because it looks at the following hardcoded path to load the resource files: /opt/microsoft/msodbcsql

    The command sqlcmd -?

    produces the following error:

    Unable to load SQLCMD resource file(s)

    Is it possible to run it using a different path for the resource files? If not can you build another release where the location of the resource files are not hard coded but tries to find them in the path?

  17. Harpreet says:

    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