Hi Martin, For some reason the table hasn't been found and the driver wanted to create a new table. I've tried to reproduce this with a shapefile with no geometry uploaded to MSSQL, but I couldn't. Can I have your sample data? Which GDAL version has been used? You could also check what happens by disabling bulk insert by adding *--config MSSQLSPATIAL_USE_BCP NO*
Thanks, Tamas 2018-05-03 19:31 GMT+02:00 Martin Landa <landa.mar...@gmail.com>: > Hi all, > > let's assume sample data: > > $ ogrinfo sample.gpkg > > 1: SOBR (Point) > 2: VLA (None) > > Append for geometry layers seems to work: > > 1) ogr2ogr -f MSSQLSpatial MSSQL:database=kn sample.gpkg sobr > > -> > > 1> select count(*) from sobr > 2> go > > ----------- > 5437 > > 2) ogr2ogr -f MSSQLSpatial -append MSSQL:database=kn sample.gpkg sobr > > -> > > 1> select count(*) from sobr > 2> go > > ----------- > 10874 > > The same procedure fails for non-geometry layers: > > 1) ogr2ogr -f MSSQLSpatial MSSQL:database=kn sample.gpkg vla > > -> > > 1> select count(*) from vla > 2> go > > ----------- > 111 > > 2) ogr2ogr -f MSSQLSpatial -append MSSQL:database=kn sample.gpkg vla > ERROR 1: Error creating layer: [Microsoft][SQL Server Native Client > 11.0][SQL Se > rver]There is already an object named 'vla' in the database. When using > the over > write option and the layer doesn't contain geometry column, you might > require to > use the MSSQLSPATIAL_LIST_ALL_TABLES config option to get the previous > layer de > leted before creating the new one. > ERROR 1: Terminating translation prematurely after failed > translation of layer VLA (use -skipfailures to skip errors) > > OK, let's try with MSSQLSPATIAL_LIST_ALL_TABLES > > 3) ogr2ogr -f MSSQLSpatial -append --config > MSSQLSPATIAL_LIST_ALL_TABLES YES MSSQL:database=kn sample.gpkg vla > > Same error: > > ERROR 1: Error creating layer: [Microsoft][SQL Server Native Client > 11.0][SQL Se > rver]There is already an object named 'vla' in the database. When using > the over > write option and the layer doesn't contain geometry column, you might > require to > use the MSSQLSPATIAL_LIST_ALL_TABLES config option to get the previous > layer de > leted before creating the new one. > ERROR 1: Terminating translation prematurely after failed > translation of layer VLA (use -skipfailures to skip errors) > > Number of records unchanged: > > 1> select count(*) from vla > 2> go > > ----------- > 111 > > It seems to me as a bug, or is there anything I miss? Thanks for > pointers, Martin > > -- > Martin Landa > http://geo.fsv.cvut.cz/gwiki/Landa > http://gismentors.cz/mentors/landa > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/gdal-dev
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev