FreeTDS (a linux ?Sybase?/Microsoft-SQL driver) is available from the EPEL repository for RedHat Enterprise Linux 6.x.
The package available on EPEL was named: freetds-0.91-2.el6.x86_64
It has a command-line query utility called ‘bsqldb’.
This utility seems to work, but it complains if your client hostname is longer than a certain length (the ones that were causing the issue had their FQDN as their HOSTNAME= value in /etc/sysconfig/network).
The bsqldb executable, when executed, complains:
bsqldb: Msg 20042, Level 2
Name too long for LOGINREC field
Took me a while to figure out that was what it was complaining about.
To work around it, you can:
- ignore it; it seems to be somewhat cosmetic
- remove the fqdn part of the /etc/sysconfig/network
- pass the -H “$( hostname -s )” parameter which will get the shortened hostname (everything before the ‘.’)