I am trying to import a plain text file with approx. 8Mio rows without geometry into SQL Server 2016 via the following ogr2ogr command
ogr2ogr -progress -append -nln dgi.te_import -f MSSQLSpatial "MSSQL:server=%dbhost%;Driver=ODBC Driver 17 for SQL Server;database=%db%;uid=%dbuser%;pwd=%dbpw%" -relaxedFieldNameMatch --config MSSQLSPATIAL_USE_BCP YES --config MSSQLSPATIAL_BCP_SIZE 10000 --config GDAL_DRIVER_PATH "C:\Program Files\QGIS 3.16\bin\gdalplugins" --config MSSQLSPATIAL_LIST_ALL_TABLES YES /vsizip/%input_file%.zip\te.txt TurnEdge
The error message is
ERROR 1: SQL Error SQLState=HY000, NativeError=0, Msg=[Microsoft][ODBC Driver 17 for SQL Server]Connection is not enabled for BCP
I`ve downloaded the MSSQLSpatial OGR Plugin from https://download.osgeo.org/osgeo4w/x86_64/release/gdal/gdal-mss/ which should have BCP Support and put the DLL into the QGIS gdalplugins folder. I am using GDAL/OGR 3.1.4 which is bundled with QGIS 3.16.8.
I´ve used the "ODBC Driver 17 for SQL Server" as well as the "SQL Server Native Client 11.0", both with the same result.
I've also fired up a simple
bcp ... queryout ... command which worked perfectly well, so i assume the database itself is BCP enabled.
I found quite some advice in the GDAL maillist, but nothing which helped so far...