mssql-cli is new command line tools for SQL Server and it is cross platform and open source. I have seen this is much better than sqlcmd, as IntelliSense is added into the tool. Also the output, query results are very well formatted and easily readable.
Lets go through the steps to install mssql-cli in Linux & in Windows
Steps to install mssql-cli on Linux
- Connect to the /etc/yum.repos.d/ directory
cd /etc/yum.repos.d/

2. Curl the Microsoft Redhat/CentOS repository
sudo curl -O https://packages.microsoft.com/config/centos/8/prod.repo

3. Rename the prod.repo to msprod.repo
sudo mv prod.repo msprod.repo

4. Install the extra packages for enterprise Linux (skipping this step may effect installing libunwind, if the package is not already available)
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

5. Install libunwind
sudo yum install libunwind

6. Now install mssql-cli
sudo yum install mssql-cli

7. Verify the installation
mssql-cli --version

Done, latest mssql-cli is now installed.
One thought on “SQL Server command line tools, mssql-cli”
Comments are closed.