As it turns out there seem to be a number of candidates out there, none of them apparently packaged for Debian, most or all of them Java-based. I picked one that seemed to have a bit of history and advertising more then one developer: SQuirrel SQL
Squirrel SQL is kind enough to at least provide an RPM for download, which is convertable to a .deb using the alien package, and thence installable with "dpkg -i", ie. (as root):
dpkg -i squirrel-sql_3.2.1-2_all.deb
will install Squirrel, and finally start it up. Unfortunately this RPM seems to be missing all of its database drivers. I found one on the MicroSoft site, where I downloaded sqljdbc_3.0.1301.101_enu.tar.gz and unpacked it in /opt/SQuirreLSQLClient/plugins/.
After this you will find two .jar files in /opt/SQuirreLSQLClient/plugins/sqljdbc_3.0/enu. In the Squirrel SQL GUI, go to Windows --> View Drivers, then right-click on "Microsoft MSSQL Server JDBC Driver" and select "Modify Driver". Then click on the "Extra Class Path" tab, and "Add" those two sqljdbc .jar files.
Click on OK, and "Microsoft MSSQL Server JDBC Driver" should now have a check mark beside it. Click on Windows --> View Aliases then the + button to add your server connection information, which should be quite straight-forward with the possible exception of the URL field: there you need to put real values in fields demarked by <...>.
This reference was MOST helpful:
apt-get install sqsh freetds-bin freetds-common
Edit /etc/freetds/freetds.conf and add something like this to the end:
[MServer] host = msuckserver port = 1433 tds version = 8.0
Edit ~/.sqshrc to contain this:
\set username=msqlloginname \set password=msqlloginpassword \set database=msqldbname \set style=vert
For the case of only one database, it seems to be sufficient to delete the above database=msqldbname line from ~/.sqshrc. And then connect as follows:
sqsh -SMServerFiguring out what to do next is a bit tricky. This will get the list of tables:
sp_tables;And this will get the table contents:
select * from tablename;