We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doin
sqsh (http://www.sqsh.org/) + freetds (http://www.freetds.org)
sqsh was primarily an isql replacement for Sybase SQL Server (now ASE) but it works just fine for connecting to SQL Server (provided you use freetds).
To compile, simply point $SYBASE to freetds install and it should work from there. I use it on my Mac all day.
The best part of sqsh are the advanced features, such as dead simple server linking (no need to set up linked servers in SQL Server), flow control and looping (no more concatenating strings and executing dynamic SQL), and invisible bulk copy/load.
Anyone who uses any other command line tool is simply crazy! :)