Please read our previous part of this tutorial How to Build a Free MS SQL Server Spatial Database Using Docker. On this article, we are going to continue connecting to SQL Server container from some popular GIS Software. Why would you need SQL Server Spatial Database? Well, this is not mandatory to have an SQL Server spatial database. But, personally, the SQL Server spatial database offers many advantages. We can store our data in a central place where accessible from anywhere. You can also put your data in the cloud by deploying the SQL Server database on Amazon, Azure or any other cloud providers. Anyway, I hope this tutorial could help anyone who needs to setup a spatial database using SQL Server.
Connect to SQL Server from Mapinfo Discover
In order to work with SQL Server, I would recommend the tool called EasyLoader. You can open and activate this tool via Tools | Tools Manager.
So basically, the EasyLoader tool is a special addon for Mapinfo Discover that can be used to export Mapinfo Tables into a SQL Server spatial table. It is very easy to use. Let me show you how to use it.
Open EasyLoader and then click ODBC. At this point, you will need to select the ODBC connection we are going to use. Please read our previous tutorial to create a new ODBC Connection in Windows 10.
You will also need to login to the SQL Server from EasyLoader. First, we need to create Map Catalog. Click the Map Catalog button to create a Map Catalog in your SQL Server database.
Now let’s add some tables. Click Source Tables and select some tables to export to the SQL Server spatial database.
You can change the Server Table Name if you want. Also, specify the Server Table Processing. In this example, I choose to Create New Table. Click the Upload button to start uploading the tables to the server. For more settings, click the Options button. Make sure the upload process complete with no errors.
Open SQL Server Spatial Table on Mapinfo Discover
In the following exercise, we are going to open the SQL Server Spatial Table on Mapinfo Discover. Go to File | Open DBMS Connection to get started. Then, select the SQL Server ODBC Connection you created earlier and you should see the list of tables that are in the server.
Choose either Linked or Live. For your information, if you choose Live, Mapinfo will directly connect to the server in real time. In most cases, this Live version is a bit slower than Linked. Specify the Folder to store the Mapinfo native table. Click OK. In a few moments, your table will be displayed in Mapinfo window.
How to Connect to SQL Server Spatial Database on ArcGIS 10.6
Let’s continue with another great GIS Software, ArcGIS. In the following exercise, we are going to connect to our SQL Server container from ArcGIS 10.6. First, open ArcMap and open the Catalog. Double-click Add Database Connection.
It will bring up the database connection window. Select SQL Server from the list and then enter the SQL Server connection details. If the server has different port than the default one (1433), type the port after the ip address with comma. See the following example.
Click OK. Now you should see the list of the spatial table in ArcGIS.
To open the spatial table in ArcGIS, simply drag and drop the table to the Map window.