-
Notifications
You must be signed in to change notification settings - Fork 85
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
Invalid precision value when inserting long string on nvarchar(max) column (Microsoft Driver 13.1) #143
Comments
This seems to be a bug with the Microsoft Driver. I tried with FreeTDS and the row was inserted with no problems. |
Glad to hear that there is a workaround by using another driver. I will have to investigate to find out what the invalid precision value would be. |
Unfortunately this Workaround does not help me as I am on a windows box and cannot use FreeTDS. This GiST provides you with test code. It doesn't matter if I use "SQL Server" ODBC Driver or "ODBC Driver 13 for SQL Server". The error is the same with both drivers. |
hi @MathMagique, any news with that error? I am facing on the same error. |
Sorry, no news on this one so far. I had too little time in the past to investigate. |
I have the same problem. @MathMagique, do you have some news about this error ?
|
Sorry, not yet :-( |
me too: DatabaseError: ODBC error |
Hello @MathMagique We have the same problem when string length is more than 1600, along with that we found below exception for data with "REAL","BIT" and "DATE" datatypes.
Thanks, |
Hi Im using make_options:
I have the same problem when prefer_unicode =True (message: [Microsoft][SQL Server Native Client 11.0]Invalid precision value) |
Similar to #282 |
The issue even happens with the latest editions:
I'm using a dynamic Tuple:
|
Hi, where did you do these changes? Thanks. |
Bug seems still open and the latest MS driver hasn't changed the issue - quite annoying for Windows users dealing with long strings |
It would seem to me that it has either been fixed at latest with ODBC driver version 17, or it was never a driver error to begin with. I can confirm that inserting strings > 1600 into NVARCHAR(max) columns using ODBC bulk inserts (aka. parameter arrays) works. In difference to the original reported error the DBMS used in this case is a community edition MSSQL 2019 server. I do not know how similar it is to Azure SQL database. Doubtful this is an MSSQL driver issue though. |
I made some tests and successfully resolved the issue by implementing the following two options within turbodbc.make_options():
Both options need to be enabled. The documentation states that their activation affects performance and behaviour. However, I seek further clarification regarding how these two options specifically influence the import of long strings. I would appreciate more clarity on this matter. If necessary, I can provide a short script that includes two CSV files to demonstrate the issue we were facing. |
Speaking more of ODBC than
By default This would make fetching everything as wide characters which is always defined to be UTF-16 a way which works on every platform, if only all the drivers would stick to the standard. In practice Linux drivers tend to have poor implementations for wide encodings. |
Hi. Im using:
Im getting this exception when I try to insert a string of length 1600+ in a nvarchar(max) column. I already tried setting to True the limit_varchar_results_to_max parameter.
Thanks.
The text was updated successfully, but these errors were encountered: