<div dir="ltr">Hi Mateusz<div><br></div><div>Thanks a lot for that. I can see that in my gdal copy it is commented out. But I also see all these paths refer to a Windows installation. Does this mean the BCP support is only available for a Windows installation?</div><div><br></div><div>Regards</div><div>Hector</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 30 Jun 2020 at 13:42, Mateusz Loskot <<a href="mailto:mateusz@loskot.net">mateusz@loskot.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Mon, 29 Jun 2020 at 15:53, Hector muro <<a href="mailto:muro.hector@gmail.com" target="_blank">muro.hector@gmail.com</a>> wrote:<br>
><br>
> As a part of a project I need to load quite big geojsons into SQL Server and I am using ogr2ogr to do so.<br>
><br>
> Here is an example command I am using:<br>
><br>
> ogr2ogr -f MSSQLSpatial "MSSQL:server=xxx;database=xxx;UID=xxx;PWD=xxx;DRIVER={ODBC Driver 17 for SQL Server}" -append --config SPATIAL_INDEX NO --config MSSQLSPATIAL_USE_BCP TRUE --config MSSQLSPATIAL_BCP_SIZE 10000 --config MSSQLSPATIAL_USE_GEOMETRY_COLUMNS NO -nln INM.nv_lv_ohline -nlt GEOMETRY -t_srs EPSG:27700 -s_srs EPSG:4326 -skipfailures -splitlistfields $DATA/data.json<br>
><br>
> I found that it is very slow and I have been checking the SQL Server profiler (as suggested already in this thread: <a href="https://lists.osgeo.org/pipermail/gdal-dev/2018-May/048520.html" rel="noreferrer" target="_blank">https://lists.osgeo.org/pipermail/gdal-dev/2018-May/048520.html</a>) and I can confirm that it is trying to insert every record one-by-one, hence the slowness.<br>
><br>
> What I can't get to understand is how to point gdal to my sql server installation.<br>
><br>
> SQL Server version: 2016<br>
> GDAL: 3.0.4<br>
<br>
Double check your GDAL is built with MSSQL_BCP_SUPPORTED=1 macro defined<br>
<a href="https://github.com/OSGeo/gdal/blob/7ce18dfea8c2c6c2d73d5824cf1c91f6e0287a75/gdal/nmake.opt#L288-L298" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/blob/7ce18dfea8c2c6c2d73d5824cf1c91f6e0287a75/gdal/nmake.opt#L288-L298</a><br>
<br>
Best regards,<br>
-- <br>
Mateusz Loskot, <a href="http://mateusz.loskot.net" rel="noreferrer" target="_blank">http://mateusz.loskot.net</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">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/mailman/listinfo/gdal-dev</a></blockquote></div>