[gdal-dev] MSSQL Driver and Bulk Copy Drivers

Tamas Szekeres szekerest at gmail.com
Thu Dec 8 01:23:09 PST 2022


Hi Seth,

The gdal nmake builds supports to build the mssql driver against MSODBC17,
by using these params in nmake.opt:

# Uncomment out the following to enable plugin with Microsoft ODBC Driver
17 for SQL Server support for MSSQL Bulk Copy.
#MSODBCSQL_VERSION = 17
#MSODBCSQL_DIR = C:\Program Files\Microsoft SQL Server\Client
SDK\ODBC\$(MSODBCSQL_VERSION)0\SDK
#MSODBCSQL_LIB =
"$(MSODBCSQL_DIR)\Lib\x86\msodbcsql$(MSODBCSQL_VERSION).lib"
#MSODBCSQL_INCLUDE = "-I$(MSODBCSQL_DIR)\Include"
-DMSODBCSQL_VERSION=$(MSODBCSQL_VERSION) -DMSSQL_BCP_SUPPORTED=1

I also think that the gisinternals builds have compiled the ODBC17 based
plugin earlier (looks like it is broken currently, I'll check that).

The recent cmake build can also be controlled in this regard by
the GDAL_USE_MSSQL_ODBC and GDAL_USE_MSSQL_NCLI parameters.

Best regards,

Tamas




Seth G <sethg at geographika.co.uk> ezt írta (időpont: 2022. dec. 7., Sze,
15:21):

> Hi all,
>
> From the Microsoft docs at
> https://learn.microsoft.com/en-us/sql/relational-databases/native-client/applications/installing-sql-server-native-client?view=sql-server-ver16
> :
>
> > The SQL Server Native Client (often abbreviated SNAC) has been removed
> from SQL Server 2022 (16.x) and SQL Server Management Studio 19 (SSMS). The
> SQL Server Native Client (SQLNCLI or SQLNCLI11) and the legacy Microsoft
> OLE DB Provider for SQL Server (SQLOLEDB) are not recommended for new
> development. Switch to the new Microsoft OLE DB Driver (MSOLEDBSQL) for SQL
> Server or the latest Microsoft ODBC Driver for SQL Server going forward.
>
> So the native SQL Server driver will be retired, however the GDAL MSSQL
> Driver only supports bulk copy (BCP) with this driver and not the "ODBC
> Driver 17 for SQL Server" - the following error is returned:
>
> > ERROR 1: SQL Error SQLState=HY000, NativeError=0, Msg=[Microsoft][ODBC
> Driver 17 for SQL Server]Connection is not enabled for BCP
>
> According to
> https://learn.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server?view=sql-server-ver16
> :
>
> > The ODBC driver comes with tools such as sqlcmd and bcp.
>
> Does anyone know if BCP can be enabled with the MS ODBC drivers?
>
> Thanks,
>
> Seth
>
>
>
> --
> web:https://geographika.net
> twitter: @geographika
> _______________________________________________
> 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/20221208/7ebce85b/attachment.htm>


More information about the gdal-dev mailing list