Create a Linked Server Between Two Docker Containers running SQL Server (T-SQL Example)

This article walks through the process of creating a linked server from a SQL Server instance on one Docker container, to a SQL Server instance on another Docker container. Both Docker containers are on the same machine.

The process is exactly the same that you would use to create any linked server (for example, even if the SQL Server instances were on separate machines and not running in a Docker container).

All examples here use Transact-SQL. This enables you to create the linked server without relying on a graphical user interface (such as SSMS).

Continue reading

How to Run SQL Server 2017 & 2019 Simultaneously on a Mac

As I write this, there are two releases of SQL Server that can be run on a Mac: SQL Server 2017 and SQL Server 2019 Preview. This article explains how to run both of these on a Mac so that they run simultaneously. No need to uninstall one before you install the other.

The key is to use a different TCP port number for each instance (the TCP port that the containers are mapped to on the host machine). If you don’t do this, you’ll get an error. SQL Server uses port 1433 by default, which is fine to use for one of your instances, but not both. Therefore you’ll need to change this for at least one of your installations.

Continue reading

Install SQL Server 2019 on a Mac

I previously explained how to install SQL Server on a Mac via a Docker container. When I wrote that, SQL Server 2017 was the latest version of SQL Server, and it had just been made available for Linux and Docker (which means that you can also install it on MacOS systems).

In late 2018, Microsoft announced SQL Server 2019 Preview, and subsequently announced general release in late 2019. The installation process for SQL Server 2019 is exactly the same as for SQL Server 2017. The only difference is that you need to use the container image for SQL Server 2019 instead of the 2017 image. Here I show you how to do that.

Also, if you already have SQL Server 2017 installed, and you want to install SQL Server 2019 without removing the 2017 version, you’ll need to allocate a different port number on your host. I show you how to do that too.

But first… if you’re using a Mac with the M1 chip, see How to Install SQL Server on an M1 Mac (ARM64).

Continue reading

How to Restore a SQL Server Database on a Mac using SQL Operations Studio

UPDATE: SQL Operations Studio (SQLOPS) has since been renamed to Azure Data Studio. The steps in this article remain the same though. In any case, I’ve also rewritten these steps (and included the equivalent screenshots) specifically for Azure Data Studio . See How to Restore a SQL Server Database on a Mac using Azure Data Studio.

Restoring a database is a piece of cake with SQL Operations Studio. It’s a similar process to doing it with SQL Server Management Studio.  Simply click Restore and follow the prompts.

This restore process allows you to navigate through the computer’s file system to locate the .bak file. This .bak file contains a backup of the database you want to restore. So when SQL Server restores the database, it’s using the .bak file to do so.

However, if you’re running your SQL Server instance inside a Docker container (which of course, you would be if you’re running SQL Server on Mac or Linux), there’s something you need to be aware of if your backup file is located outside the Docker container.

Continue reading

How to Install SQLOPS on a Mac

UPDATE: SQL Operations Studio (SQLOPS) has since been renamed to Azure Data Studio. The steps in this article remain the same though. In any case, I’ve also rewritten these steps (and included the equivalent screenshots) specifically for Azure Data Studio . See How to Install Azure Data Studio on a Mac.

SQL Operations Studio (also abbreviated to SQLOPS) is a free tool that you can use to manage SQL Server. It uses a graphical user interface (GUI) that helps you view the various databases and objects within a SQL Server instance. It can run on Windows, macOS, and Linux, and it’s also designed to be used with Azure SQL Database, and Azure SQL Data Warehouse.

Here I explain how to install SQLOPS onto a Mac, then how to use it to connect to SQL Server.

Continue reading