How to Query a SQL Server Database from Linux.
This article shows how to query a database attached to a SQL Server 2012 instance from a linux server.
First you need to download and install the SQL Server ODBC Driver 1.0 for Linux from here. However, before installing the driver, make sure the following RPM packages have been installed: glibc-2.5, libgcc-4.1.2, libstdc++-4.1.2, e2fsprogs-libs-1.39, krb5-libs-1.6.1, and openssl-0.9.8e. Then follow the instructions provided on the "Install Instructions" section of the download link.
Once the driver has been installed, you need to configure the SQL Server
instance for mixed mode authentication, create a SQL login on the SQL Server
instance, provide the login permissions on the database you would like to query
from Linux, and then you are ready to query the instance as shown in the image
Something that I have to mention is that not only sqlcmd is available when Microsoft SQL Server ODBC Driver 1.0 for Linux is installed, but also the bcp utility is installed with the driver.
I would like to express my appreciation to Paul Melendez at my workplace for joining me on this SQL Server adventure, and perform the installation of the drive on the Linux server.
.Send mail to
questions or comments about this web site.