freetds

Connect to Microsoft SQL Server and Sybase databases from Linux/Mac.

brewmacoslinux
Try with needOr install directly
Source

About

Libraries to talk to Microsoft SQL Server and Sybase databases

Commands

tsqlbcpfreebcpdefncopydatacopyosqlisql

Examples

connect to SQL Server database and run queries$ tsql -S server_name -U username -P password -D database_name
test connection to remote database server$ tsql -S 192.168.1.100 -U sa -P password -p 1433
bulk copy data from CSV into SQL Server table$ bcp database_name.dbo.table_name in data.csv -S server -U user -P pass -c
export SQL Server table data to file$ bcp database_name.dbo.table_name out output.txt -S server -U user -P pass -c
check if freetds is configured correctly$ tsql -C