In the previous blog post we walked through getting our SQL Server 2019 Docker Image and booting up our Container.
This gave us the Linux version of SQL Server 2019 on our Windows Desktop.
However, no-one likes using SQLCMD for everything, so we’ll want to connect a GUI.
I’m currently using Azure Data Studio for a lot of my work (mostly because of the Jupyter Notebooks – I’ll write something about those on my SQL Server blog) and as that’s designed as a platform independent SQL Server studio I’ll be using that with my Container.
If you followed my previous blog to a tee then you’ll know that we have a SQL Server set up with a map from my desktop’s port 14330 to the Container’s 1433, which is SQL Server’s port.
We COULD use localhost for connecting, but I like to use IP address so we need to find the IP of our desktop. Mine is currently 192.168.1.69 as found by running IPCONFIG in a dos window:
So now all we need to do is boot up Azure Data Studio and make a connection to the SQL Server using our IP, the port number, and the SA account with the password we used when creating the Container:
And you can see that we have now connected to our machine and that it lists the OS as Linux:
You can now happily run queries against it as you would any other SQL Server:
The only noticeable issue is that because we are in a container, we have no access to the Windows OS disks, only those “disks” inside the container itself:
We will therefore discuss how to add databases to this in another blog post because it’s not the nicest thing to do.
Lastly, one thing I did want to note is that a Container has all the resources it needs inside a Container, but it does call out to the OS in order to use its CPUs and RAM. Therefore if you look above you’ll see that it has automatically created 8 tempDB files to mimic my 8 cores in the desktop. It also comes with the default configuration, so you need to remember to do things such as limit your memory usage etc.
Hence, it’s just like having a SQL Server except for the disks (and the fact it’s Linux).