Using sqlcmd on Linux - wiltondb/wiltondb GitHub Wiki

sqlcmd is the official command-line utility for Microsoft SQL Server. It also can be used with WiltonDB.

Microsoft provides 2 versions of sqlcmd with almost identical functionality:

The latter Golang version is open-source and has official portable binaries for Linux, it can be used the following way:

$ curl -LO https://github.com/microsoft/go-sqlcmd/releases/download/v1.4.0/sqlcmd-v1.4.0-linux-amd64.tar.bz2
$ tar xjvf sqlcmd-v1.4.0-linux-amd64.tar.bz2
$ ./sqlcmd -S 127.0.0.1,1433 -U wilton -P wilton
1> select @@version
2> go
version                                                                                                                                                                                                                                                         
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8
Oct 22 2023 17:48:32
Copyright (c) Amazon Web Services
PostgreSQL 15.4 (EL 1:15.4.wiltondb3.3_2-2.el8) on x86_64-redhat-linux-gnu (Babelfish 3.3.0)                                        

(1 row affected)