Graphical MS-SQL Clients for a Ubuntu Desktop
I occasionally need to do minor edits to a MS-SQL database running on one of our servers. I’m using an evaluation of DbVisualizer at the moment to do this (it’s Java based and uses something called the jTDS JDBC driver to talk to MS-SQL). trouble is it’s expensive and I’m wondering if there is anything else I can use. I’m preferably after something which is either a native application (or Java, Python, Perl etc. ) but not Windows/Wine/Mono. Something which has a similar UI to MySQL Workbench or DbVisualizer which I’m currently using. Any ideas?
7 Answers 7
I use DBeaver. There is a Debian package (.deb) available on their website. It is similar to MySQL Workbench.
To install: download the .deb file from the download page, change to the directory you put the DBWeaver deb in and run sudo dpkg -i dbeaver-*.deb or run sudo snap install dbeaver-ce for snap users and run sudo flatpak install flathub io.dbeaver.DBeaverCommunity for flatpak users.
Sqlectron is an open-source, cross-platform SQL client with a clean, simple GUI that supports Microsoft SQL Server (along with PostgreSQL, MySQL, Cassandra, and SQLite).
The simplest way to install dbeaver in Ubuntu:
sudo add-apt-repository ppa:serge-rider/dbeaver-ce sudo apt-get update sudo apt-get install dbeaver-ce
After to install it, you can create a shortcut in desktop area using the option Create Laucher and typing the «dbeaver-ce» in command field.
For developers who are using Visual Studio Code on Ubuntu, another option would be to install the SQL Server extension:
This extension allows you to access multiple SQL server databases, run queries and scripts directly from the IDE, as well as perform other operations and tasks.
For simple use cases, I’ve found this to be a quick and easy option for MS-SQL access on Ubuntu, without the need for installing separate software.
SQL Operation Studio, runs on Windows, MacOS, and Linux. A great review is here on RedGate website. What is great is that now there is an extension for SQL Profiler, also the intellisense and document format are great.
I quote from their website:
SQLOPS is the new open source, multiplatform tool for working with SQL Server. We began by seeing how easy it is to install, then showed the interface. Next, we looked at some common tasks such as editing queries, then reviewed the cool snippets feature. Finally, we looked at how to ‘peek’ into your database. Although still in preview, SQLOPS already has many features that make it a worthy addition to your toolkit.»
Install the SQL Server command-line tools sqlcmd and bcp on Linux
The following steps install the command-line tools, Microsoft ODBC drivers, and their dependencies. The mssql-tools package contains:
- sqlcmd: Command-line query utility.
- bcp: Bulk import-export utility.
Install the tools for your platform:
This article describes how to install the command-line tools. If you are looking for examples of how to use sqlcmd or bcp, see the Next steps at the end of this article.
sqlcmd and bcp are available in mssql-tools18 for x64 and arm64 architectures. For a modern alternative across Linux, macOS, and Windows, see go-sqlcmd utility.
Install tools on Linux
These instructions are for installing the Microsoft ODBC 18 packages. For previous versions, see Install the Microsoft ODBC driver for SQL Server (Linux).
Use the following steps to install the mssql-tools18 on Red Hat Enterprise Linux.
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /etc/yum.repos.d/mssql-release.repo
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
sudo yum remove mssql-tools unixODBC-utf16 unixODBC-utf16-devel
sudo yum install -y mssql-tools18 unixodbc-dev
sudo yum check-update sudo yum update mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile
To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
Use the following steps to install the mssql-tools18 on SUSE Linux Enterprise Server.
curl -O https://packages.microsoft.com/keys/microsoft.asc rpm --import microsoft.asc
zypper ar https://packages.microsoft.com/config/sles/15/prod.repo
zypper ar https://packages.microsoft.com/config/sles/12/prod.repo
sudo zypper install -y mssql-tools18 unixodbc-dev
sudo zypper refresh sudo zypper update mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile
To make sqlcmd or bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
Use the following steps to install the mssql-tools18 on Ubuntu.
- Ubuntu 18.04 is supported starting with SQL Server 2019 (15.x) CU 3.
- Ubuntu 20.04 is supported starting with SQL Server 2019 (15.x) CU 10.
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
sudo apt-get update sudo apt-get install mssql-tools18 unixodbc-dev
sudo apt-get update sudo apt-get install mssql-tools18
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile
To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
Install tools on macOS
Install Homebrew if you don’t have it already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To install the tools for macOS El Capitan and later versions, use the following commands:
# brew untap microsoft/mssql-preview if you installed the preview version brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release brew update brew install mssql-tools18
Install tools on Docker
If you run SQL Server in a Docker container, the SQL Server command-line tools are already included in the SQL Server Linux container image. If you attach to a running container with an interactive bash shell, you can run the tools locally.
If you are creating a container with the SQL Server command-line tools, you should add ACCEPT_EULA=Y to the installation command to silently accept the EULA, and not interrupt image creation. An example final command as part of installation on an Ubuntu-based image is:
sudo ACCEPT_EULA=Y apt-get install mssql-tools18 unixodbc-dev
Offline installation
If your Linux machine doesn’t have access to the online repositories used in the previous sections, you can download the package files directly. These packages are located in the Microsoft repository, https://packages.microsoft.com.
If you successfully installed with the steps in the previous sections, you do not need to download or manually install the following package(s). This is only for the offline scenario.
sudo yum localinstall msodbcsql18-.rpm sudo yum localinstall mssql-tools18-.rpm
rpm -qpR msodbcsql18-.rpm rpm -qpR mssql-tools18-.rpm
sudo zypper install msodbcsql18-.rpm sudo zypper install mssql-tools18-.rpm
rpm -qpR msodbcsql18-.rpm rpm -qpR mssql-tools18-.rpm
sudo dpkg -i msodbcsql18_.deb sudo dpkg -i mssql-tools18_.deb
If this doesn’t work for your Debian package, you can inspect the required dependencies with the following commands:
dpkg -I msodbcsql18__amd64.deb | grep "Depends:" dpkg -I mssql-tools18__amd64.deb | grep "Depends:"
Next steps
For an example of how to use sqlcmd to connect to SQL Server and create a database, see one of the following quickstarts:
For an example of how to use bcp to bulk import and export data, see Bulk copy data to SQL Server on Linux.
Contribute to SQL documentation
Did you know that you can edit SQL content yourself? If you do so, not only do you help improve our documentation, but you also get credited as a contributor to the page.
Feedback
Submit and view feedback for