I am trying to import an ESRI shape file into SQL Server 2019 under Windows 11.
I have a problem similar to Attempting to use ogr2ogr to convert shapefile to SQL Server table; getting error "unable to find driver mssqlspatial", but the answers there are not helping.
I installed QGIS 3.32.1 in Windows 11 in order to get ogr2ogr. I added "C:\Program Files\QGIS 3.32.1\bin" and even "C:\Program Files\QGIS 3.32.1\apps\gdal\lib\gdalplugins" to my system path. But I get this error:
PS C:\Users\drood...> ogr2ogr -f MSSQLSpatial "MSSQL:server=XPS-17-I9-2;driver=SQL Server;database=Duflo 2001;Trusted_Connection=True;" "D:\OneDrive\Documents\Work\DevDat\India NSS\District shape file 2009\geo2_in2009.shp" -a_srs "EPSG:4326" -lco UPLOAD_GEOM_FORMAT=wkt
ERROR 1: Unable to find driver `MSSQLSpatial'.
Adding "--config MSSQLSPATIAL_USE_BCP NO" per elrobis's answer doesn't help. bendecko says to download GDAL from Tamas Szekeres's site and "install it" but I don't know what that means in practice, perhaps because bendecko downloaded an .msi and currently I see only .zip files
MSSQLSpatial
? The easiest way to install binaries from gisinternals is actually to download a zip, unzip it into some directory, and run "sdkshell.bat".