This post was authored by Meet Bhagdev, Program Manager, Microsoft
Hi, all. We are delighted to share the production-ready release of the Microsoft ODBC Driver 13.1 for macOS El Capitan and Sierra. The new driver enables access to SQL Server, Azure SQL Database and Azure SQL DW from any C/C++ application on macOS.
- Native install experience – The driver can now be installed with brew. Instructions on how to do this are below.
- Azure AD support – You can now use Azure AD authentication (username/password) to centrally manage identities of database users and as an alternative to SQL Server authentication.
- Always Encrypted support – You can now use Always Encrypted. Always Encrypted lets you transparently encrypt the data in the application, so that SQL Server will only handle the encrypted data and not plaintext values. Even if the SQL instance or the host machine is compromised, an attacker gets ciphertext of the sensitive data.
- Table Valued Parameters (TVP) support – TVP support allows a client application to send parameterized data to the server more efficiently by sending multiple rows to the server with a single call. You can use the ODBC Driver 13.1 to encapsulate rows of data in a client application and send the data to the server in a single parameterized command.
AlwaysOn support – This release supports AlwaysOn high availability and disaster recovery. Customers have the option to use AlwaysOn by using features with capabilities like these:
- Ability to specify whether an application is connecting to an AlwaysOn Availability Group Cluster (multi subnet failover)
- Ability to specify application intent as read-only versus read/write
- Ability to make transparent connections to AlwaysOn Availability Groups. The driver quickly discovers the current AlwaysOn topology of your server infrastructure and connects to the current active server transparently.
- BCP API support – You can use functions through the ODBC driver as described here.
- SQL Server 2017 support – This release is tested and certified against the latest SQL Server release.
- TLS 1.2 support – This release supports TLS 1.2 connections to SQL Server.
Install the ODBC Driver on macOS
- /usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)“
- brew tap microsoft/msodbcsql https://github.com/Microsoft/homebrew-mssql-release
- brew update
- brew install msodbcsql
- #for silent install ACCEPT_EULA=y brew install msodbcsql
Try our sample
Once you install the driver that runs on a supported macOS distro, you can use this C sample to connect to SQL Server/Azure SQL DB/Azure SQL DW. To download the sample and get started, follow these steps:
- wget “https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/tutorials/c/linux/sample_c_linux.c“
- gcc sample_c_linux.c -o sample_c_linux -lodbc -w #make sure you change the servername, username and password in the connections string
Please file bugs, questions and issues on our Issues page. We welcome contributions, questions and issues of any kind. Happy programming!
Meet Bhagdev (email@example.com)