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