[gdal-dev] MSSQLSpatial driver from GDAL 3.2.2 does not export data

Pedro Venâncio pedrongvenancio at gmail.com
Wed Apr 7 04:16:05 PDT 2021


Hi,

I'm trying to export some data from shapefile to a MSSQLServer database
with the MSSQLSpatial driver, but I'm getting an error when doing it with
ogr2ogr from GDAL 3.2.2:

ogr2ogr --version
GDAL 3.2.2, released 2021/03/05

ogr2ogr.exe -progress -f MSSQLSpatial "MSSQL:server=HP-OMEN\SQLEXPRESS;
driver={ODBC Driver 17 for SQL Server}; database=TEST_DB; uid=user;
pwd=pass; active_schema=dbo" -lco DIM=2 D:\CAOP_Distritos_2020_4326.shp
CAOP_Distritos_2020_4326 -overwrite -nlt MULTIPOLYGON -lco
GEOMETRY_NAME=geom -lco FID=id -nln dbo.caop_2020_distritos_4326_novo
-s_srs EPSG:4326 -a_srs EPSG:4326 -nlt PROMOTE_TO_MULTI

GDAL command output:
Process was unexpectedly terminated
Execution failed after 2.84 seconds

This procedure creates the table structure, lists the new table in
geometry_columns, but no data is exported. So, the new table is just empty.


Doing exactly the same with ogr2ogr from GDAL 3.1.4, all goes fine:

ogr2ogr --version
GDAL 3.1.4, released 2020/10/20

ogr2ogr.exe -progress -f MSSQLSpatial "MSSQL:server=HP-OMEN\SQLEXPRESS;
driver={ODBC Driver 17 for SQL Server}; database=TEST_DB; uid=user;
pwd=pass; active_schema=dbo" -lco DIM=2 D:\CAOP_Distritos_2020_4326.shp
CAOP_Distritos_2020_4326 -overwrite -nlt MULTIPOLYGON -lco
GEOMETRY_NAME=geom -lco FID=id -nln dbo.caop_2020_distritos_4326 -s_srs
EPSG:4326 -a_srs EPSG:4326 -nlt PROMOTE_TO_MULTI
0...10...20...30...40...50...60...70...80...90...100 - done.


Had something changed between those two versions that can justify this
behaviour?

Thank you very much!

Best regards,
Pedro Venâncio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210407/8af92e65/attachment.html>


More information about the gdal-dev mailing list