<div dir="ltr"><div>Hi,</div><div><br></div><div>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:
</div><div><br></div><div>ogr2ogr --version<br>GDAL 3.2.2, released 2021/03/05<br><br>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<br><br>GDAL command output:<br>Process was unexpectedly terminated<br>Execution failed after 2.84 seconds</div><div><br></div><div>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.<br></div><div><br></div><div><br></div><div>Doing exactly the same with ogr2ogr from GDAL 3.1.4, all goes fine:<br></div><div><br></div><div>ogr2ogr --version<br>GDAL 3.1.4, released 2020/10/20<br><br>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<br>0...10...20...30...40...50...60...70...80...90...100 - done.</div><div><br></div><div><br></div><div>Had something changed between those two versions that can justify this behaviour?</div><div><br></div><div>Thank you very much!</div><div><br></div><div>Best regards,</div><div>Pedro VenĂ¢ncio<br></div></div>