You still did not say what database you are using. When you type "SQL server", do you mean the product called Microsoft SQL Server? If so, there is a type-4
JDBC driver that runs just fine on Linux. As far as command line tools go, I don't know of any Linux command line tools that work with SQL Server (though doing a search for "SQL Server" in your distro's package manager might bring something up). But once you have the JDBC driver, then just about any Java-based tools should let you make those queries.