Jump to content


Connecting to MSSQL from bash

mssql bash linux

  • Please log in to reply
1 reply to this topic

#1 evoman91



  • Joined: 21-January 08
  • Location: Nottingham, UK

Posted 29 July 2013 - 12:13

Hi All, 


What is the best option to connect to MSSQL from bash?


I've seen a couple of methods such as unixODBC but all seem a little clunky... 

#2 ichi


    Akihabara Style

  • Tech Issues Solved: 5
  • Joined: 20-December 04

Posted 29 July 2013 - 22:29

UnixODBC with FreeTDS works great but it's a bit tedious to configure, more so if you are connecting with several different versions of MSSQL as you have to find out with version of TDS works better with each one.


I've only used it once to set up a SQL Server monitoring script for SiteScope, connecting to four MSSQL hosts. If I had to connect with several different servers more often I'd have to develop some kind of frontend or I'd go insane keeping track of the configurations for the different servers (actually I think there's some kind of GUI frontend, but it seems to be even more complicated that going straight to edit the config files).


Then again out of every method I tried back then, that turned out to be the most reliable.