pypyodbc
pypyodbc copied to clipboard
Varchar values longer than 1024 chars are truncated
This seems to be a problem for both SQL_WVARCHAR & SQL_VARCHAR types. Any values larger than 1024 chars are truncated.
Reproduction Steps
- Execute a SQL query which will return a value greater than 1024 chars in length from a variable length column (e.g. SQL nvarchar(max)).
Reproducible with the following
Python/Pypyodbc versions Python v3.5.2 Pypyodbc v1.3.4.3
ODBC Drivers Tested (64-bit):
Name | Version | File | Driver Date |
---|---|---|---|
ODBC Driver 13 for SQL Server | 2017.140.800.90 | MSODBCSQL13.DLL | 11/07/2017 |
SQL Server Native Client 11.0 | 2011.110.6540.00 | SQLNCLI11.DLL | 24/06/2016 |
SQL Server Native Client 10.0 | 2009.100.1600.01 | SQLNCLI10.DLL | 03/04/2010 |
Workaround
It is possible to resolve this by following the workaround detailed in the issues below (originally raised on Google code repo).
https://github.com/jiangwen365/pypyodbc/issues/62 https://code.google.com/archive/p/pypyodbc/issues/44 https://github.com/bpla2112/pypyodbc/issues/44