[gdal-dev] ogr2ogr doesn't connect to MS SQL Server

Andrea Giudiceandrea andreaerdna at libero.it
Thu Oct 20 09:36:02 PDT 2022


Hi Michael,
the GDAL/OGR library needs the "ogr_MSSQLSpatial.dll" file to properly 
activate the MSSQLSpatial GDAL/OGR driver ("MSSQL:").

You can check if the MSSQLSpatial GDAL/OGR driver is supported by your 
ogr2ogr tool using the following command in the OSGeo4W Shell:

ogr2ogr --formats | find "MSSQL"

If it outputs the string "MSSQLSpatial -vector- (rw+): Microsoft SQL 
Server Spatial Database (BCP)", then it means such driver is supported, 
otherwise not.

If you cannot use the OSGeo4W "Setup" program to install such file, you 
can try to fix the issue just downloading the "gdal-mss" OSGeo4W package 
from [1] and extracting from it the "ogr_MSSQLSpatial.dll" file to the 
"\apps\gdal\lib\gdalplugins\" folder in your QGIS installation dir.
The exact "gdal-mss" OSGeo4W package to download depends on the exact 
GDAL version installed with QGIS.

Best regards.

[1] 
https://download.osgeo.org/osgeo4w/v2/x86_64/release/gdal/gdal-mss/?C=M&O=D


Il 20/10/2022 16:56, Reetz, Michael (NLPV) ha scritto:
>
> I’ve found msodbcsql17.dll in C:\Program Files\QGIS 3.22.8\bin\1033 
> and C:\Program Files\QGIS 3.22.8\bin.
>
> Gdal-mss seems not to be on my computer. But since SQL Server Native 
> Client isn’t supported by MS SQL Server 2019 , this shouldn’t be a 
> Problem.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221020/9a1bc397/attachment.htm>


More information about the gdal-dev mailing list