[gdal-dev] MSSQLSpatial not using BCP to load

Hector muro muro.hector at gmail.com
Tue Jun 30 06:26:32 PDT 2020


Hi Mateusz

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?

Regards
Hector

On Tue, 30 Jun 2020 at 13:42, Mateusz Loskot <mateusz at loskot.net> wrote:

> On Mon, 29 Jun 2020 at 15:53, Hector muro <muro.hector at gmail.com> wrote:
> >
> > As a part of a project I need to load quite big geojsons into SQL Server
> and I am using ogr2ogr to do so.
> >
> > Here is an example command I am using:
> >
> > 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
> >
> > I found that it is very slow and I have been checking the SQL Server
> profiler (as suggested already in this thread:
> https://lists.osgeo.org/pipermail/gdal-dev/2018-May/048520.html) and I
> can confirm that it is trying to insert every record one-by-one, hence the
> slowness.
> >
> > What I can't get to understand is how to point gdal to my sql server
> installation.
> >
> > SQL Server version: 2016
> > GDAL: 3.0.4
>
> Double check your GDAL is built with MSSQL_BCP_SUPPORTED=1 macro defined
>
> https://github.com/OSGeo/gdal/blob/7ce18dfea8c2c6c2d73d5824cf1c91f6e0287a75/gdal/nmake.opt#L288-L298
>
> Best regards,
> --
> Mateusz Loskot, http://mateusz.loskot.net
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200630/b96ab9a4/attachment.html>


More information about the gdal-dev mailing list