[gdal-dev] [OFFICIAL] MSSQL GDAL bulk insert with append to varchar(max) column

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] [OFFICIAL] MSSQL GDAL bulk insert with append to varchar(max) column

SANDALL, Jason

Hi,

 

After upgrading GDAL to a version that supports MSSQL bulk inserts (v2.2.3) I have found an issue with data append operations using ogr2ogr between MSSQL spatial tables. If the destination table has a column of type varchar(max) then it is only populated with the first character from the source record. No such issue for nvarchar(max) types or varchar with a restricted length.

The GDAL command I am using is simply:

ogr2ogr -append -f MSSQLSpatial "MSSQL:server=SQLSERVER;database=DATABASE;trusted_connection=yes" "MSSQL:server=SQLSERVER;database=DATABASE;trusted_connection=yes;tables=SOURCETABLE" -nln DESTTABLE

 

The only work around for this is to disable bulk inserts first with:

SET MSSQLSPATIAL_USE_BCP=NO

 

We are using MSSQL Server 2014.  Has anyone else come across this?

 

Thanks

Jason

************************************************************************
Confidentiality: This email and its contents and any attachments are intended only for the above named. As the email may contain confidential or legally privileged information, if you are not the above named person or responsible for delivery to the above named, or suspect that you are not an intended recipient please delete or destroy the email and any attachments immediately.

Security and Viruses: This note confirms that this email message has been swept for the presence of computer viruses. We cannot accept any responsibility for any damage or loss caused by software viruses.

Monitoring: The Council undertakes monitoring of both incoming and outgoing emails. You should therefore be aware that if you send an email to a person within the Council it may be subject to any monitoring deemed necessary by the organisation from time to time. The views of the author may not necessarily reflect those of the Council.

Access as a public body: The Council may be required to disclose this email (or any response to it) under the Freedom of Information Act, 2000, unless the information in it is covered by one of the exemptions in the Act.

Legal documents: The Council does not accept service of legal documents by email.
************************************************************************


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev