-
Notifications
You must be signed in to change notification settings - Fork 435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendStringParametersAsUnicode not considered for SQLServerBulkCopy? #1181
Comments
@pbcornelius thanks for letting us know, the team will look into this. |
Hi @pbcornelius , |
Thanks for looking into this. Here's my code. It should reproduce that error with any H2 -> SQL Server 2017 non-UTF CP, VARCHAR to NVARCHAR transfer.
A workaround that's better than the one I posted above is to again wrap the
Where
|
Hi @pbcornelius , |
It seemed to work in a quick test with this as the source ဦ should be outside of the CP1252 scope. I did not set |
Hi @pbcornelius , |
#1193 merged |
Driver version
7.4.1
Problem description
Expected behaviour:
SQLServerBulkCopy
should treatVARCHAR
andLONGVARCHAR
likeLONGNVARCHAR
andNVARCHAR
ifsendStringParametersAsUnicode = True
; or, alternatively, provide a seperate configuration for this (if there is one, I apologise, but I could not find it here or here).Actual behaviour:
It does not. As a result, unicode characters in
VARCHAR
columns are lost during transfer. This means one cannot transfer unicode from databases that do not distinguish betweenVARCHAR
andNVARCHAR
(such as H2).Error message/stack trace:
None
Any other details that can be helpful:
A workaround is to wrap the ResultSetMetaData and manually swap
VARCHAR
forNVARCHAR
, e.g.:The text was updated successfully, but these errors were encountered: