Install SQL Server Tools on Linux

LinuxLove

In the last article I have gone through the process of installing SQL Server on a Linux machine and connecting to the instance via SQL Management Studio.

Of course SQL Server on Linux comes with a set of command-line tools and ODBC drivers that you can use for managing SQL and database instances, in this article I will show how to install SQL Server tools on Linux.

Install SQL Server Tools on Linux

SQL Server Tools that are available under Linux are

  • sqlcmd Command-line query utility
  • bcp Bulk import-export utility

Like in the previous post I will be using an Ubuntu 16.04 machine to carry on all examples.

Connect to the Linux server via SSH, run sudo su - and import SQL Server Tools repository key via the following command

Install SQL Server Tools Repository Key

Run the following command to register the repository itself

Install SQL Server Tools Repository

Next update repository metadata with the following command

Install SQL Server Tools Update Repository

Finally issue the sudo apt-get install mssql-tools to install tools’ binaries (text will scroll as there is a good number of packages that will be downloaded)

Install SQL Server Tools

Install SQL Server Tools Wizard

Install SQL Server Wizard License

Install SQL Server Tools Completion

Once SQL Server Tools have been installed you can connect to the local instance with the following command sqlcmd -S localhost -U SA -P '' omitting the -P switch you will be prompted for a password

Connect to SQL on Linux

Congratulations now you can query, manage and create databases on your Linux SQL Server.

Of course managing databases or SQL Statements is out the article scope but this can be a good starting point.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s