freetds
FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases.
Query MSSQL with tsql command
TDSVER=7.0 tsql -H 192.168.1.123 -U userx -P 12345678-p 1433
Show databases:
Toggle line numbers
1 select name from master..sysdatabases;
2 go
Show tables:
Toggle line numbers
1 SELECT * FROM information_schema.tables;
2 go