Welcome to QGIS Tutorial for beginners. Today I am going to show you how to open a Microsoft SQL Server spatial table on QGIS. MS SQL is a powerful database server to store spatial datasets. If you don’t have SQL Server on your network, you can build a free one. Read my previous article to build a free SQL Server using Docker container. If you have many GIS datasets, you can upload them to SQL Server using ogr2ogr tool or using Global Mapper. Global Mapper 18 full version is a great piece of software. You can easily export any GIS data to SQL Server with this software.
OK, lets back to the topic of opening the SQL Server table on QGIS. Once you have a working SQL Server spatial database on your network, we can start using it. Please read this article to export GIS data to SQL Server using Global Mapper. To open this table, go to Layers | Add Layer | Add MSSQL Spatial Layer.
First, we need to create a new connection. Click New to open the create a new MSSQL Connection window.
Enter your SQL Server details including the IP address, port number, username, and password. Then, select the database you want to connect. Click OK. Click Connect to see the tables in the database. Select which table you want to open and click Add. You can open more than one tables at a time.
Derek
January 24, 2022Did you ever get a driver error trying to connect to MSQL Server in a container? If so, how did you fix it?
Adil Majeed
February 12, 2022By upgrading to 3.22.3 version which resolves the issue of MS SQL Server driver