If forced to use an MS-SQL database, I find it much easier and
more convenient to use the excellent sqsh shell. On our Ubuntu boxes,
installing it was as simple as apt-get install sqsh.
Unfortunately, DarwinPorts doesn't include it. Building from source
was somewhat problematic due to OS X's none-GNU-readline readline.h
(it's actually part of the BSD editline library).
Here's what I needed to do:
Install FreeTDS:
port install freetds
Download and untar sqsh.
Configure as you would normally, setting $SYBASE to point to the top of the FreeTDS install:
SYBASE=/opt/local ./configure --with-readline
Edit src/Makefile and append freetds
to line #18 so it looks like this:
SYBASE_INCDIR = -I$(SYBASE_OCOS)/include/freetds
Modify the header/library paths for libreadline to point to the version from DarwinPorts:
READLINE_LIBDIR = -L/opt/local/lib
READLINE_INCDIR = -I/opt/local/include/
make and make install